Git Version Control System (VCS) Basics

Danny Lee
3 min readMar 2, 2020

--

INTRODUCTION

I thought this week I’d write just 8 bits about basic Git usage, just to take a byte out of the subject 😉. Over the next few weeks, I plan to go into more advanced topics. I hope my ambition doesn’t come back to byte me in the bithind 😬.

  1. What is a Version Control System?

The ability to ‘undo’ and ‘redo’ changes is so common in my digital life I almost take it for granted. Nearly every editor (text, video, graphic, music, code) has multiple layers of undo, redo, cut and paste. Think of it like a massive Mead Trapper Keeper that holds all of your changes, and from which you can pull pages out, archive them, and restore them at a later time. You can also Ditto them and branch off and create something new, and wildly different starting from the same starting point, but in a different repository.

2. What is a repository?

I don’t want to go off-course and fall into too many rabbit-holes, but I think the pictures on this page can explain it well!

3. What is Git and Github?

Git is a brand name of a Version Control System (VCS), there are many others, and the history of Git is interesting. It was developed by the same man who developed Linux, Linux Torvalds. Its, by far, the most popular by number of repositories.

4. What does Git Workflow consist of?

The 4 elements: working directory, staging area, local repository (HEAD) and remote repository (MASTER) are illustrated here:

5. What are the Git actions taking place ?

  • add: adds a file or multiple files to the staging area
  • commit: adds all staged files to the local repository
  • push: adds all local committed repository files to the remote repository
  • fetch: gets files from the remote repository, but does not add it to the working files (kind of harmless in nature)
  • pull: gets files and updates your local repository (HEAD) with changes from the remote repository
  • checkout: switches currently active branch or restore files from earlier version
  • merge/rebase: these commands bring branches back into your master

6. What is master branch?

A master branch is like your tree trunk, its the branch from which all other branches emerge from. There are some useful illustrations here. The only difference from a real life tree would be that the branches can be merged back into the trunk. Something you wouldn’t want in the wild:

7. Where’s a good place to start?

There are a ton of resources on Git. Some are definitely better than others. I would definitely recommend to start:

More advanced:

  • The Pro Git book by Scott Chacon and Ben Straub available online for free and printed.

8. Where can I find some sweet git jokes?

Right here, with pictures.

--

--

Danny Lee

a nyc based coding enthusiast, handyman, farmer at-heart, artist and future surfer