Introduction to Git
Git is a distributed version control system, it tracks every change to your code over time, lets you go back to any previous state, and makes it possible for multiple people to work on the same project without stepping on each other's changes.
Why use version control?
- History, every commit is a snapshot you can return to.
- Branching, try risky changes on a separate line of work without touching the working code.
- Collaboration, merge everyone's work together instead of emailing zip files around.
Installing Git and setting your identity
Check whether Git is already installed:
git --version
Every commit is stamped with an author, so set your identity once per machine:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
--global applies these settings to every repository on your machine, not just the current one.