Exercise: Introduction To GitHub
Introduction to GitHub

Welcome to Your Skills Exercise!
👋 Hey there BOYCash! 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 repositories, branches, and pull requests, which we will explore in more detail throughout this exercise.
Creating a GitHub Account
If you don't already have a GitHub account, you will need to create one before you can start using the platform. 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.
Understanding GitHub Terminology
Before we dive into the exercise, it's essential to understand some basic GitHub terminology:
- Repository: A repository is a central location where all the files for a project are stored.
- Branch: A branch is a separate line of development in a repository. It allows you 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 the codebase at a particular point in time.
- Pull request: A pull request is a request to merge changes from one branch into another.
Exercise Steps
Now that we have covered the basics, let's move on to the exercise steps. Your task is to create a new repository on GitHub and add a few files to it. Here's how:
Step 1: Create a New Repository
- 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.
- Click on the "Create repository" button.
Step 2: Add Files to the Repository
- Click on the "Code" button in the top right corner of the screen.
- Click on the "Add file" button.
- Select the file type you want to add (e.g., text file, image file).
- Enter the file name and contents.
- Click on the "Commit changes" button.
Step 3: Create a New Branch
- Click on the "Branches" tab in the top navigation bar.
- Click on the "New branch" button.
- Enter a name for your branch.
- Click on the "Create branch" button.
Step 4: Make Changes to the Branch
- Click on the "Code" button in the top right corner of the screen.
- Click on the "Edit file" button.
- Make some changes to the file.
- Click on the "Commit changes" button.
Step 5: Create a Pull Request
- Click on the "Pull requests" tab 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.
Conclusion
Congratulations! You have completed the exercise and learned the basics of GitHub. You now have a new repository with a few files and a new branch with some changes. You have also created a pull request to merge the changes into the main branch. This is just the beginning of your GitHub journey, and we will explore more advanced features and concepts in future exercises.
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 to navigate and understand the various features and terminology. In this article, we will answer some of the most frequently asked questions about GitHub to help you get started.
Q1: 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.
Q2: What is a repository?
A: A repository is a central location where all the files for a project are stored. It's like a digital file cabinet where you can store and manage all the files related to a project.
Q3: What is a branch?
A: A branch is a separate line of development in a repository. It allows you to work on a new feature or fix a bug without affecting the main codebase. Think of it like a separate folder where you can work on a new feature without affecting the rest of the project.
Q4: What is a commit?
A: A commit is a snapshot of the changes made to the codebase at a particular point in time. It's like taking a photo of the code at a specific moment, so you can track changes and revert to previous versions if needed.
Q5: What is a pull request?
A: A pull request is a request to merge changes from one branch into another. It's like asking someone to review and merge your changes into the main codebase.
Q6: 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.
- Click on the "Create repository" button.
Q7: How do I add files to a repository?
A: To add files to a repository, follow these steps:
- Click on the "Code" button in the top right corner of the screen.
- Click on the "Add file" button.
- Select the file type you want to add (e.g., text file, image file).
- Enter the file name and contents.
- Click on the "Commit changes" button.
Q8: How do I create a new branch?
A: To create a new branch, follow these steps:
- Click on the "Branches" tab in the top navigation bar.
- Click on the "New branch" button.
- Enter a name for your branch.
- Click on the "Create branch" button.
Q9: How do I make changes to a branch?
A: To make changes to a branch, follow these steps:
- Click on the "Code" button in the top right corner of the screen.
- Click on the "Edit file" button.
- Make some changes to the file.
- Click on the "Commit changes" button.
Q10: How do I create a pull request?
A: To create a pull request, follow these steps:
- Click on the "Pull requests" tab 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.
Conclusion
GitHub is a powerful platform for version control and collaboration on software development projects. By understanding the basics of GitHub, you can start using the platform to manage your code and collaborate with others. We hope this Q&A article has helped you get started with GitHub and answered some of your frequently asked questions.
What's Next?
In the next article, we will cover more advanced features and concepts of GitHub, including labels, milestones, and issues. Stay tuned for more exciting learnings and exercises!