Exercise: Introduction To GitHub
Introduction to GitHub

Welcome to Your Skills Exercise!
👋 Hey there Zoliii79! 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 others and collaborate on a global scale.
Creating a GitHub Account
To get started with GitHub, you'll need to create a GitHub 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.
- 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 GitHub Repository
For this exercise, we'll create a new GitHub 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 (e.g., "my-first-repo").
- Choose a repository type (e.g., "Public" or "Private").
- Click on the "Create repository" button.
Exercise: Creating a New File
Now that we have a repository, let's create a new file. Here's what you need to do:
- Click on the "Code" button in the top navigation bar.
- Click on the "New file" button.
- Enter a name for your file (e.g., "README.md").
- Add some content to your file (e.g., a brief description of your project).
- Click on the "Commit new file" button.
Exercise: Committing Changes
Now that we have a new file, let's commit our changes. Here's what you need to do:
- Click on the "Code" button in the top navigation bar.
- Click on the "Commit" button.
- Enter a commit message (e.g., "Added README file").
- Click on the "Commit changes" button.
Conclusion
Congratulations! You've completed the exercise and learned the basics of GitHub. In this exercise, we covered:
- Creating a GitHub account
- Understanding GitHub terminology
- Creating a new repository
- Creating a new file
- Committing changes
What's Next?
In the next exercise, we'll cover how to create a new branch and make changes to our code. We'll also learn how to create a pull request and merge changes into our main branch.
Additional Resources
If you're new to GitHub, here are some additional resources to help you get started:
- GitHub documentation: https://docs.github.com
- GitHub tutorials: https://help.github.com/en/github/getting-started-with-github
- GitHub community: https://github.community
Get Help
Introduction
Welcome to the GitHub Q&A article! In this article, we'll cover some of the most frequently asked questions about GitHub. Whether you're a beginner or an experienced user, you'll find answers to your questions here.
Q1: What is GitHub?
A1: 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.
Q2: How do I create a GitHub account?
A2: To create a GitHub account, follow these steps:
- 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.
Q3: What is a repository?
A3: A repository (or repo) is a collection of files and folders that make up a project. Think of it as a digital file cabinet where you can store and manage your code.
Q4: How do I create a new repository?
A4: To create a new repository, 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 (e.g., "my-first-repo").
- Choose a repository type (e.g., "Public" or "Private").
- Click on the "Create repository" button.
Q5: What is a branch?
A5: A branch is a separate line of development in a repository. Think of it as a separate path that you can take to develop a new feature or fix a bug.
Q6: How do I create a new branch?
A6: To create a new branch, follow these steps:
- Log in to your GitHub account.
- Navigate to your repository.
- Click on the "Code" button in the top navigation bar.
- Click on the "New branch" button.
- Enter a name for your branch (e.g., "feature/new-feature").
- Click on the "Create branch" button.
Q7: What is a commit?
A7: A commit is a snapshot of changes made to a repository. Think of it as a digital bookmark that marks the changes you've made to your code.
Q8: How do I commit changes?
A8: To commit changes, follow these steps:
- Log in to your GitHub account.
- Navigate to your repository.
- Click on the "Code" button in the top navigation bar.
- Click on the "Commit" button.
- Enter a commit message (e.g., "Added new feature").
- Click on the "Commit changes" button.
Q9: What is a pull request?
A9: A pull request is a request to merge changes from one branch into another. Think of it as a request to merge your changes into the main branch.
Q10: How do I create a pull request?
A10: To create a pull request, follow these steps:
- Log in to your GitHub account.
- Navigate to your repository.
- Click on the "Pull requests" button in the top navigation bar.
- 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.
Q11: What is a fork?
A11: A fork is a copy of a repository that you can use to make changes without affecting the original repository. Think of it as a separate copy of the code that you can use to experiment with new ideas.
Q12: How do I fork a repository?
A12: To fork a repository, follow these steps:
- Log in to your GitHub account.
- Navigate to the repository you want to fork.
- Click on the "Fork" button.
- Select the repository you want to fork into.
- Click on the "Fork" button.
Q13: What is a clone?
A13: A clone is a copy of a repository that you can use to work on your code locally. Think of it as a local copy of the code that you can use to make changes.
Q14: How do I clone a repository?
A14: To clone a repository, follow these steps:
- Log in to your GitHub account.
- Navigate to the repository you want to clone.
- Click on the "Code" button in the top navigation bar.
- Click on the "Clone or download" button.
- Select the protocol you want to use (e.g., HTTPS or SSH).
- Copy the clone URL.
- Open a terminal or command prompt and navigate to the directory where you want to clone the repository.
- Run the command
git clone <clone URL>
.
Conclusion
We hope this Q&A article has helped you understand some of the basics of GitHub. Whether you're a beginner or an experienced user, we're here to help you with any questions you may have. Don't hesitate to ask in the comments below!