Exercise: Introduction To GitHub
Introduction to GitHub

Welcome to Your Skills Exercise!
👋 Hey there Davidlinl! Welcome to your Skills exercise! If you're 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.
Creating a GitHub Account
To get started with GitHub, you'll 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 basic 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. It allows developers to work on a new feature or fix a bug without affecting the main codebase.
- Commit: A commit is a snapshot of the changes made to a repository. It's like a save point in a game.
- Pull request: A pull request is a request to merge changes from one branch into another.
Exercise: Creating a New Repository
Now that we've covered the basics, let's create a new repository. Here's what you need to do:
- 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, private, or internal).
- Click on the "Create repository" button.
Exercise: Creating a New File
Now that we have a new repository, let's create a new file. Here's what you need to do:
- Click on the repository name in the top left corner of the screen.
- Click on the "New file" button.
- Enter a name for your file and a brief description.
- Add some content to your file (e.g., a simple text file5. Click on the "Commit new file" button.
Exercise: Creating a New Branch
Now that we have a new file, let's create a new branch. Here's what you need to do:
- Click on the repository name in the top left corner of the screen.
- Click on the "New branch" button.
- Enter a name for your branch and a brief description.
- Click on the "Create branch" button.
Conclusion
Congratulations! You've completed the exercise and learned the basics of GitHub. You now know how to create a new repository, file, and branch. You've also learned some basic GitHub terminology.
What's Next?
In the next exercise, we'll cover how to use issues to organize your work and collaborate with others. We'll also cover how to create a pull request and merge changes from one branch into another.
Tips and Resources
- GitHub documentation: https://docs.github.com
- GitHub tutorials: https://github.com/learn
- GitHub community: https://github.community
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 Git repositories.
Q: How do I create a new repository on GitHub?
A: To create a new repository on GitHub, follow these steps:
- 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, private, or internal).
- Click on the "Create repository" button.
Q: How do I create a new file in a repository?
A: To create a new file in a repository, follow these steps:
- Click on the repository name in the top left corner of the screen.
- Click on the "New file" button.
- Enter a name for your file and a brief description.
- Add some content to your file (e.g., a simple text file).
- Click on the "Commit new file" button.
Q: How do I create a new branch in a repository?
A: To create a new branch in a repository, follow these steps:
- Click on the repository name in the top left corner of the screen.
- Click on the "New branch" button.
- Enter a name for your branch and a brief description.
- Click on the "Create branch" button.
Q: What is a pull request?
A: A pull request is a request to merge changes from one branch into another. It allows developers to review and discuss changes before they are merged into the main codebase.
Q: How do I create a pull request?
A: To create a pull request, follow these steps:
- Click on the repository name in the top left corner of the screen.
- Click on the "Pull requests" tab.
- Click on the "New pull request" button.
- Select the branch you want to merge into the main codebase.
- Click on the "Create pull request" button.
Q: What is a commit?
A: A commit is a snapshot of the changes made to a repository. It's like a save point in a game.
Q: How do I create a commit?
A: To create a commit, follow these steps:
- Make some changes to your code.
- Click on the "Commit" button.
- Enter a commit message and description.
- Click on the "Commit" button.
Q: What is a repository?
A: A repository is a collection of files and folders that make up a project.
Q: How do I create a repository?
A: To create a new repository, follow the steps outlined in the previous question.
Q: What is a branch?
A: A branch is a separate line of development in a repository. It allows developers to work on a new feature or fix a bug without affecting the main codebase.
Q: How do I create a new branch?
A: To create a new branch, follow the steps outlined in the previous question.
Q: What is a fork?
A: A fork is a copy of a repository that is created by a user. It allows developers to make changes to the original repository without affecting the main codebase.
Q: How do I create a fork?
A: To create a fork, follow these steps:
- Click on the repository name in the top left corner of the screen.
- Click on the "Fork" button.
- Enter a name for your fork and a brief description.
- Click on the "Fork" button.
Q: What is a clone?
A: A clone is a copy of a repository that is created on a local machine. It allows developers to work on a project without affecting the main codebase.
Q: How do I create a clone?
A: To create a clone, follow these steps:
- Open a terminal or command prompt.
- Navigate to the directory where you want to create the clone.
- Run the command
git clone <repository-url>
. - Enter the repository URL and press Enter.
Conclusion
I hope this Q&A article has helped you understand the basics of GitHub and how to use it to manage your codebase. If you have any further questions or need help with a specific topic, feel free to ask in the comments!