Skip to main content

Introduction to GitHub

In this chapter, we will explore the fundamentals of GitHub. GitHub is a web-based hosting service for Git repositories that facilitates collaboration among developers. While Git is a version control system, GitHub provides additional features for sharing and managing code. We will compare Git and GitHub, understand the benefits of using GitHub for code storage and collaboration, and delve into concepts specific to GitHub, such as forking and pull requests. Additionally, we will highlight popular projects hosted on GitHub and guide you through creating a GitHub account. The next step is to proceed to the chapter on Working with Remotes.

Objectives​

By the end of this chapter, you should be able to:

  1. Compare and contrast Git and GitHub
  2. List use cases for GitHub

What is GitHub?​

GitHub is a web-based Git repository hosting service. Simply put, it is a tool that enables collaboration by hosting shared Git repositories that teams of developers can all contribute to. While GitHub uses Git, the functionality it provides is VERY different from Git so make sure you understand that Git and GitHub are not the same thing.

In short, Git is a Version Control System. GitHub is an online platform for hosting and sharing code, text files and even more complex file formats.

Why use GitHub?​

Not only does GitHub provide a great way for you to store your code in a remote location (in case something happens to your local machine), it’s a fantastic way to collaborate with other developers both privately and publicly. Many large open source projects are hosted on GitHub, which makes it very easy to examine the code both on GitHub and locally. In the next couple of chapters, we will learn how to move code from our local repository to a remote repository on GitHub using the push command, as well as retrieve code from a remote repository on GitHub using the pull command. We’ll also learn about GitHub specific concepts like forking and pull requests.

Want to get a sense for how pervasive GitHub is in the development community? Here are some projects you may have heard of that are hosted there:

  1. React
  2. Angular
  3. Ruby on Rails
  4. Twitter Bootstrap
  5. Node.js
  6. JQuery
  7. Homebrew

Getting started with GitHub​

If you don’t have an account with GitHub yet, head to github.com and create an account – signing up is easy! Be sure to use whatever email address is in your .gitconfig for your email address when you sign up with GitHub. If you’d rather sign up with a different email address, change your .gitconfig accordingly. You’ll run into some minor annoyances if there’s a mismatch between the email address in your GitHub profile and the email address in your .gitconfig.

When you’re ready, move on to Working with Remotes