Exercise: Introduction To GitHub
Introduction to GitHub

Welcome to Your Skills Exercise!
👋 Hey there JeffMendes08! Welcome to your Skills exercise! If you are new to GitHub, you might find your fellow developers use issues to organize their work and collaborate. We will do the same! That's another lesson, but today, we will introduce you to the basics.
What is GitHub?
GitHub is a web-based platform for version control and collaboration on software development projects. It allows developers to store and manage their code in a centralized location, making it easier to collaborate with others and track changes to the codebase. GitHub provides a range of features, including:
- Version control: GitHub allows developers to track changes to their codebase over time, making it easier to identify and fix errors.
- Collaboration: GitHub enables multiple developers to work on the same project simultaneously, making it easier to collaborate and share code.
- Open-source: GitHub provides a platform for open-source projects, allowing developers to share their code with the community and receive feedback and contributions.
Getting Started with GitHub
To get started with GitHub, you will need to create an account. Here's a step-by-step guide:
- Create a GitHub account: Go to the GitHub website and sign up for an account. You can use your email address or your social media account to create an account.
- Set up your profile: Once you have created your account, set up your profile by adding a profile picture, bio, and other information.
- Create a new repository: To create a new repository, click on the "+" button in the top right corner of the GitHub dashboard. Give your repository a name and description, and choose the type of repository you want to create (e.g. public, private, or internal).
- Initialize your repository: Once you have created your repository, initialize it by running the command
git add .
and thengit commit -m "Initial commit"
.
Basic GitHub Concepts
Here are some basic GitHub concepts you should understand:
- Repository: A repository is a collection of files and folders that are stored on GitHub. It's like a project folder, but it's stored online.
- Branch: A branch is a separate version of your repository. You can think of it like a separate project folder that you can work on independently.
- Commit: A commit is a snapshot of your repository at a particular point in time. You can think of it like a save point in a game.
- Pull request: A pull request is a request to merge changes from one branch into another. It's like a proposal to update your project.
Exercise: Create a New Repository
Now it's your turn to create a new repository! Follow these steps:
- Create a new repository: Go to the GitHub dashboard and click on the "+" button in the top right corner. Give your repository a name and description, and choose the type of repository you want to create (e.g. public, private, or internal).
2 Initialize your repository: Once you have created your repository, initialize it by running the command
git add .
and thengit commit -m "Initial commit"
. - Create a new branch: Create a new branch by running the command
git branch new-branch
. - Make changes to your repository: Make some changes to your repository by adding a new file or modifying an existing file.
- Commit your changes: Commit your changes by running the command
git add .
and thengit commit -m "Made some changes"
.
Conclusion
Congratulations! You have completed the exercise and created a new repository on GitHub. You have learned the basics of GitHub, including how to create a new repository, initialize it, and make changes to it. You have also learned about basic GitHub concepts, such as repositories, branches, commits, and pull requests.
What's Next?
Now that you have completed this exercise, you can move on to the next lesson, which will cover how to use issues to organize your work and collaborate with others. You will learn how to create and manage issues, assign tasks to team members, and track progress on your project.
Additional Resources
If you want to learn more about GitHub, here are some additional resources you can use:
- GitHub documentation: The GitHub documentation provides a comprehensive guide to using GitHub, including tutorials, guides, and reference materials.
- GitHub tutorials: GitHub provides a range of tutorials that cover various topics, including how to use GitHub, how to collaborate with others, and how to use GitHub's features.
- GitHub community: The GitHub community is a great place to connect with other developers, ask questions, and share knowledge.
Get Feedback and Share Your Progress
Frequently Asked Questions
Q: What is GitHub?
A: GitHub is a web-based platform for version control and collaboration on software development projects. It allows developers to store and manage their code in a centralized location, making it easier to collaborate with others and track changes to the codebase.
Q: What is the difference between GitHub and Git?
A: Git is a version control system that allows developers to track changes to their codebase. GitHub is a web-based platform that provides a centralized location for developers to store and manage their code, as well as collaborate with others.
Q: How do I create a new repository on GitHub?
A: To create a new repository on GitHub, follow these steps:
- Go to the GitHub dashboard and click on the "+" button in the top right corner.
- Give your repository a name and description, and choose the type of repository you want to create (e.g. public, private, or internal).
- Initialize your repository by running the command
git add .
and thengit commit -m "Initial commit"
.
Q: What is a branch in GitHub?
A: A branch is a separate version of your repository. You can think of it like a separate project folder that you can work on independently.
Q: How do I create a new branch in GitHub?
A: To create a new branch in GitHub, follow these steps:
- Run the command
git branch new-branch
. - Switch to the new branch by running the command
git checkout new-branch
.
Q: What is a commit in GitHub?
A: A commit is a snapshot of your repository at a particular point in time. You can think of it like a save point in a game.
Q: How do I commit changes to my repository?
A: To commit changes to your repository, follow these steps:
- Run the command
git add .
. - Run the command
git commit -m "Made some changes"
.
Q: What is a pull request in GitHub?
A: A pull request is a request to merge changes from one branch into another. It's like a proposal to update your project.
Q: How do I create a pull request in GitHub?
A: To create a pull request in GitHub, follow these steps:
- Go to the GitHub dashboard and navigate to the repository you want to create a pull request for.
- Click on the "New pull request" button.
- Select the branch you want to merge into the main branch.
- Click on the "Create pull request" button.
Q: What is the difference between a public and private repository on GitHub?
A: A public repository is visible to everyone on the internet, while a private repository is only visible to the owner and those with permission to access it.
Q: How do I make my repository public or private on GitHub?
A: To make your repository public or private on GitHub, follow these steps:
- Go to the GitHub dashboard and navigate to the repository you want to make public or private.
- Click on the "Settings".
- Scroll down to the "Repository settings" section.
- Click on the "Public" or "Private" button.
Q: What is the GitHub API?
A: The GitHub API is a set of APIs that allow developers to interact with GitHub programmatically. It provides a way to access GitHub data and perform actions on GitHub repositories.
Q: How do I use the GitHub API?
A: To use the GitHub API, you will need to create a GitHub account and obtain a personal access token. You can then use the API to access GitHub data and perform actions on GitHub repositories.
Q: What is GitHub Actions?
A: GitHub Actions is a feature of GitHub that allows developers to automate tasks and workflows on GitHub. It provides a way to create custom workflows that can be triggered by events such as push, pull request, or deployment.
Q: How do I use GitHub Actions?
A: To use GitHub Actions, you will need to create a GitHub account and navigate to the repository you want to automate. You can then create a new workflow by clicking on the "New workflow" button and selecting the type of workflow you want to create.
Conclusion
We hope this Q&A article has helped you understand the basics of GitHub and how to use it to manage your code and collaborate with others. If you have any further questions, please don't hesitate to ask.