Overview

A quick tutorial on the basics of git. Terms that I use early on in the article but are defined later are italicized for reference

What is git? What is Github?

Git is a version control tool for programmers: meaning it records and keeps track of changes in a set of files. Using git to keep track of your codebase has many advantages, such as:

  1. Constant backups of your progress: if you mess up badly while coding and you've made a lot of commits, you can easily revert back to a previous version of your code, thus minimizing the progress you lose.

  2. (Mostly) painless collaboration: if you are working on a project with another person, git will keep track of your changes separately. If you pull your partner's changes, git will try to merge your changes together automatically, thus removing the need to awkwardly copy-paste the changes your partner made into your code.

  3. Documentation: A good git log will show you (and others who view your repository) a complete "timeline" of your project's development, as well as when each change was added and by whom.

However, git by itself is not very useful when collaborating with others. All the files are on your local machine: unless you have your code on a flash drive and constantly pass it back and forth between your team, how can you be sure that your code (and the files git is tracking) is up to date? Enter Github: a cloud hosting service for your git projects. By pushing your commits to a Github repository, your team members can simply pull from the same source whenever they want to ensure everyone has the same code.

Last updated