Exercise: Introduction To GitHub
Introduction to GitHub

Welcome to Your Skills Exercise!
👋 Hey there, KyleliuNDHU! 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 a step-by-step guide:
- Go to GitHub.com: Navigate to github.com and click on the "Sign up" button.
- Choose a username: Select a unique username that will identify you on GitHub.
- Create a password: Enter a strong password that will secure your account.
- Add your email address: Enter your email address to receive notifications and updates from GitHub.
- Verify your email address: GitHub will send a verification email to your email address. Click on the link in the email to verify your account.
Understanding GitHub Terminology
Before we dive into the exercise, let's cover some essential GitHub terminology:
- Repository (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 different versions of the codebase simultaneously.
- Commit: A commit is a snapshot of the codebase at a particular point in time. It's a way to save changes to the codebase.
- Pull request: A pull request is a request to merge changes from one branch into another.
Exercise: Create a New Repository
Now that you have a GitHub account, let's create a new repository. Here's a step-by-step guide:
- Log in to GitHub: Navigate to github.com and log in to your account.
- Click on the "+" button: Click on the "+" button in the top-right corner of the screen to create a new repository.
- Enter repository details: Enter a name for your repository, a description, and choose a license.
- Create the repository: Click on the "Create repository" button to create the repository.
Exercise: Create a New File
Now that have a new repository, let's create a new file. Here's a step-by-step guide:
- Navigate to your repository: Navigate to your repository by clicking on the repository name in the top navigation bar.
- Click on the "New file" button: Click on the "New file" button in the top-right corner of the screen.
- Enter file details: Enter a name for your file and choose a file type (e.g., Markdown, Text).
- Create the file: Click on the "Create file" button to create the file.
Exercise: Commit Changes
Now that you have a new file, let's commit the changes. Here's a step-by-step guide:
- Navigate to your repository: Navigate to your repository by clicking on the repository name in the top navigation bar.
- Click on the "Commit" button: Click on the "Commit" button in the top-right corner of the screen.
- Enter commit message: Enter a commit message to describe the changes you made.
- Commit the changes: Click on the "Commit" button to commit the changes.
Conclusion
Congratulations! You've completed the exercise and learned the basics of GitHub. You now know how to create a new repository, create a new file, and commit changes. Practice makes perfect, so be sure to experiment with GitHub and try new things.
What's Next?
Introduction
GitHub is a powerful platform for version control and collaboration on software development projects. However, it can be overwhelming for beginners. In this article, we'll answer some of the most frequently asked questions about GitHub to help you get started.
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 user-friendly interface for using Git. Think of GitHub as a website that hosts your Git repository, making it easier to collaborate with others and track changes to your codebase.
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.
- Enter a name for your repository, a description, and choose a license.
- Click on the "Create repository" button to create the repository.
Q: How do I create a new file in a repository?
A: To create a new file in a repository, follow these steps:
- Navigate to your repository by clicking on the repository name in the top navigation bar.
- Click on the "New file" button in the top-right corner of the screen.
- Enter a name for your file and choose a file type (e.g., Markdown, Text).
- Click on the "Create file" button to create the file.
Q: How do I commit changes to a repository?
A: To commit changes to a repository, follow these steps:
- Navigate to your repository by clicking on the repository name in the top navigation bar.
- Click on the "Commit" button in the top-right corner of the screen.
- Enter a commit message to describe the changes you made.
- Click on the "Commit" button to commit the changes.
Q: What is a branch in GitHub?
A: A branch in GitHub is a separate line of development in a repository. It allows developers to work on different versions of the codebase simultaneously. Think of a branch as a separate version of your codebase 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:
- Navigate to your repository by clicking on the repository name in the top navigation bar.
- Click on the "New branch" button in the top-right corner of the screen.
- Enter a name for your branch and choose a base branch (e.g., master).
- Click on the "Create branch" button to create the branch.
Q: What is a pull request in GitHub?
A: A pull request in GitHub is a request to merge changes from one branch into another. It's a way to collaborate with others and review changes before they're merged into the main codebase.
Q: How do I create a pull request in GitHub?
A: To create a pull request in GitHub, follow these steps:
- Navigate to your repository by clicking on the repository name in the top navigation bar.
- Click on the "Pull requests" tab in the top navigation bar.
- Click on the "New pull request" button.
- Choose the source branch (e.g., feature/new-feature) and the target branch (e.g., master).
- Click on the "Create pull request" button to create the pull request.
Q: What is a fork in GitHub?
A: A fork in GitHub is a copy of a repository that you can modify independently. It's a way to create a new version of a repository that you can work on without affecting the original repository.
Q: How do I fork a repository in GitHub?
A: To fork a repository in GitHub, follow these steps:
- Navigate to the repository you want to fork by clicking on the repository name in the top navigation bar.
- Click on the "Fork" button in the top-right corner of the screen.
- Choose a name for your fork and click on the "Fork" button to create the fork.
Conclusion
GitHub is a powerful platform for version control and collaboration on software development projects. By understanding the basics of GitHub, you can take your coding skills to the next level. We hope this Q&A article has helped you get started with GitHub. Happy coding!