Exercise: Introduction To GitHub
Introduction to GitHub

Welcome to Your Skills Exercise!
👋 Hey there wssss1! 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 with the community and receive feedback and contributions.
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: A repository is a collection of files and folders that make up a project.
- Branch: A branch is a separate version of a repository that 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.
- 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 on GitHub. 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 (public or private).
- 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 "Code" button in the top navigation bar.
- Click on the "New file" button.
- Enter a name for your file and add some content.
- 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 to do:
- Click on the "Code" button in the top navigation bar.
- Click on the "New branch" button.
- Enter a name for your branch and click on the "Create branch" button.
Exercise: Creating a New Commit
Now that we have a new branch, let's create a new commit. Here's what you need to do:
- Click on the "Code" button in the top navigation bar.
- Click on the "Commit new file" button.
- Enter a commit message and click on the "Commit" button.
Conclusion
Congratulations! You have completed the exercise and learned the basics of GitHub. You now know how to create a new repository, file, branch, and commit. Practice makes perfect, so be sure to experiment with GitHub and try out new features.
What's Next?
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 a repository and a branch?
A: A repository is a collection of files and folders that make up a project. A branch is a separate version of a repository that allows developers to work on a new feature or fix a bug without affecting the main codebase.
Q: What is a commit?
A: A commit is a snapshot of the changes made to a repository. It's a way to save the changes made to the codebase and track the history of the project.
Q: What is a pull request?
A: A pull request is a request to merge changes from one branch into another. It's a way to review and approve changes made to the codebase before merging them into the main branch.
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 (public or private).
- Click on the "Create repository" button.
Q: How do I create a new file on GitHub?
A: To create a new file on GitHub, follow these steps:
- Click on the "Code" button in the top navigation bar.
- Click on the "New file" button.
- Enter a name for your file and add some content.
- Click on the "Commit new file" button.
Q: How do I create a new branch on GitHub?
A: To create a new branch on GitHub, follow these steps:
- Click on the "Code" button in the top navigation bar.
- Click on the "New branch" button.
- Enter a name for your branch and click on the "Create branch" button.
Q: How do I create a new commit on GitHub?
A: To create a new commit on GitHub, follow these steps:
- Click on the "Code" button in the top navigation bar.
- Click on the "Commit new file" button.
- Enter a commit message and click on the "Commit" button.
Q: What is the difference between a public and private repository?
A: A public repository is visible to everyone on the internet, while a private repository is only visible to the owner and those with permission to access it.
Q: How do I invite someone to collaborate on my repository?
A: To invite someone to collaborate on your repository, follow these steps:
- Go to your repository's settings page.
- Click on the "Collaborators" tab.
- Enter the email address of the person you want to invite.
- Click on the " collaborator" button.
Q: How do I create an issue on GitHub?
A: To create an issue on GitHub, follow these steps:
- Go to your repository's issues page.
- Click on the "New issue" button.
- Enter a title and description for your issue.
- Click on the "Submit new issue" button.
Q: How do I assign an issue to someone on GitHub?
A: To assign an issue to someone on GitHub, follow these steps:
- Go to your repository's issues page.
- Click on the issue you want to assign.
- Click on the "Assignee" dropdown menu.
- Select the person you want to assign the issue to.
Q: How do I close an issue on GitHub?
A: To close an issue on GitHub, follow these steps:
- Go to your repository's issues page.
- Click on the issue you want to close.
- Click on the "Close issue" button.
Conclusion
We hope this Q&A article has helped you understand the basics of GitHub and how to use it to manage your code and collaborate with others. If you have any further questions, feel free to ask!