Understanding and Installing Git
This tutorial will help you understand what Git is and how to install it.
Note for Americans: Git is a harsh slang word in British English, comparable to a**hole. Just keep that in mind if you are conversing with anyone in the profession who speaks British English. :)
What is Git
Git is a really smart content management tool, that also works well for version control. What is version control? It is a way to keep track of the changes in your code. It is like an undo for your whole project directory, not just your Word documents.
At the most fundamental level, Git is a way to take snapshots of your project folders at a specific point in time. It is like you copy all of the contents of your project folder and paste them in a special snapshot folder. Each time you take a snapshot, you add a new folder in the snapshot folder. Git is the software tool that takes care of making the snapshots, and gives you the ability to name certain snapshots, retrieve old snapshots, and easily collaborate with others and merge their code with yours.
In Git language, making a snapshot is called a commit
.
There is a middle step between making changes to your code and making a snapshot or commit. This middle step is called staging
. You can think of it as staging or preparing your files for the snapshot. This middle step lets you commit some files that have changed, without committing others.
For this tutorial, you will only be using the very basics of Git; staging, committing, and pushing (which you will learn about later).
The workflow for using Git is actually pretty simple:
- Make changes to your code (edit, add or delete files and folders)
- Stage the files and folders you want to commit
- Commit the changes
Here are some good articles for understanding Git theory.
- https://matthew-brett.github.io/curious-git/index.html
- http://rogerdudler.github.io/git-guide/
- http://practical-neuroimaging.github.io/git_parable.html
- http://matthew-brett.github.io/pydagogue/foundation.html
And here are some helpful sites to practice using Git.
- https://onlywei.github.io/explain-git-with-d3/
- http://pel-daniel.github.io/git-init/index.html
- https://learngitbranching.js.org/
Install Git
Install Git from https://git-scm.com/download
The installation is pretty straightforward, just accept all the default settings.
For Windows
Here is a video tutorial for installing Git on Windows
For MacOS
And here is a video tutorial for installing Git on MacOS. I recommend the first option using Homebrew.