Exercise: Introduction To GitHub
Introduction to GitHub

Welcome to Your Skills Exercise!
👋 Hey there ThiagoJustinoTI! 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 code and revert to previous versions if needed.
- 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 and collaborate with others.
Creating a GitHub Account
To get started with GitHub, you need to create an account. Here's how:
- Go to the GitHub website (www.github.com) and click on the "Sign up" button.
- Enter your email address, username, and password.
- Fill out the required information, including your name and location.
- Click on the "Create account" button.
Understanding GitHub Terminology
Before we dive into the exercise, let's cover some essential GitHub terminology:
- Repository (or repo): A repository is a collection of files and folders that make up a project.
- Branch: A branch is a separate line of development in a repository.
- Commit: A commit is a snapshot of changes made to a repository.
- Pull request: A pull request is a request to merge changes from one branch into another.
Exercise: Creating a Repository
Now that you have a GitHub account, let's create a repository. Here's how:
- Log in to your GitHub account.
- Click on the "+" button in the top-right corner of the screen.
- Select "New repository" from the dropdown menu.
- Enter a name for your repository and a brief description.
- Choose a repository type (e.g., public or private).
- Click on the "Create repository" button.
Exercise: Creating a Branch
Now that you have a repository, let's create a branch. Here's how:
- Navigate to your repository.
- Click on the "Branch" dropdown menu.
- Select "New branch" from the dropdown menu.
- Enter a name for your branch.
- Click on the "Create branch" button.
Exercise: Committing Changes
Now that you have a branch, let's commit some changes. Here's how:
- Make some changes to your code (e.g., add a new file or modify an existing one).
- Click on the "Commit" button.
- Enter a commit message.
- Click on the "Commit" button.
Exercise: Creating a Pull Request
Now that you have committed some changes, let's create a pull request. Here's how:
- Navigate to your repository.
- Click on the "Pull requests" tab.
- 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.
Conclusion
Congratulations! You have completed the exercise and learned the basics of GitHub. Remember to practice regularly to become more comfortable with the platform. In the next exercise, we will cover more advanced topics, including issues and pull requests.
What's Next?
In the next exercise, we will cover the following topics:
- Issues: We will learn how to create and manage issues in a repository.
- Pull requests: We will learn how to create and manage pull requests in a repository.
- Collaboration: We will learn how to collaborate with others on a repository.
Additional Resources
If you want to learn more about GitHub, here are some additional resources:
- GitHub documentation: The official GitHub documentation provides a comprehensive guide to using the platform.
- GitHub tutorials: GitHub provides a range of tutorials to help you learn the basics of the platform.
- GitHub community: The GitHub community is a great place to connect with other developers and learn from their experiences.
Get Help
Frequently Asked Questions
In this article, we will answer some of the most frequently asked questions about GitHub.
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 code. GitHub is a web-based platform that provides a centralized location for developers to store and manage their code using Git.
Q: How do I create a GitHub account?
A: To create a GitHub account, go to the GitHub website (www.github.com) and click on the "Sign up" button. Enter your email address, username, and password, and fill out the required information.
Q: What is a repository?
A: A repository is a collection of files and folders that make up a project. It is the central location for storing and managing code using Git.
Q: What is a branch?
A: A branch is a separate line of development in a repository. It allows developers to work on different versions of a project simultaneously.
Q: What is a commit?
A: A commit is a snapshot of changes made to a repository. It is a way to save changes to the codebase and track the history of changes.
Q: What is a pull request?
A: A pull request is a request to merge changes from one branch into another. It is a way to collaborate with others on a project and review changes before they are merged into the main branch.
Q: How do I create a pull request?
A: To create a pull request, navigate to your repository, click on the "Pull requests" tab, and click on the "New pull request" button. Select the branch you want to merge into the main branch and click on the "Create pull request" button.
Q: What is an issue?
A: An issue is a way to track and manage bugs or tasks in a project. It is a way to collaborate with others on a project and track progress.
Q: How do I create an issue?
A: To create an issue, navigate to your repository, click on the "Issues" tab, and click on the "New issue" button. Enter a title and description for the issue and click on the "Create issue" button.
Q: What is a fork?
A: A fork is a copy of a repository that is created by a user. It allows users to make changes to the codebase without affecting the original repository.
Q: How do I fork a repository?
A: To fork a repository, navigate to the repository you want to fork, click on the "Fork" button, and select the account you want to fork the repository to.
Q: What is a clone?
A: A clone is a copy of a repository that is created on a local machine. It allows users to work on a project locally and then push changes to the remote repository.
Q: How do I clone a repository?
A: To clone a repository, navigate to the repository you want to clone, click on the "Clone or download" button, and select the clone option.
Q: What is a merge?
A: A merge is the process of combining changes from one branch into another. It is a way to integrate changes from different branches into a single branch.
Q: How do I merge branches?
A: To merge branches, navigate to your repository, click on the "Pull requests" tab, and click on the "Merge pull request" button. Select the branch you want to merge into the main branch and click on the "Merge" button.
Conclusion
We hope this Q&A article has helped you understand some of the most frequently asked questions about GitHub. If you have any more questions, feel free to ask in the comments.