git: a tool for wizards
Chris Mangus, MyLife.com
git is a version control system
What is Version Control?
Version control is a system that records
changes to a file or set of files over time so that
you can recall specific versions later
Why would you need version
● To save older versions of a file
● To review past changes
● To insure against mistakes
● To revert to older versions
● To maintain a history
● To put a name to who changed what
So, what is git anyway?
git is a distributed version control
system, that is open source and made
with speed in mind
Quick git History
■ Linus Torvalds was using a DVCS named
BitKeeper, but then BitKeeper withdrew the
free version of its product
■ This inspired Linus to create his own DVCS
to keep up with the demands of thousands of
people working on the Linux kernel
Git and the competition
And by competition I mean
SVN and Mercurial
● Online vs Offline
○ No need to get on the company VPN if you only
have to local work. Since git is a full repository
locally, you don’t need a network connection to use
● Ease of Use
Git vs SVN
Git vs SVN
Data Representation is different as well
There are tools for that
So you think the
command line is scary?
One of the quickest ways to get a GUI with git,
is to just type in git gui into your console.
It will pop up a basic GTK GUI to do most
things with Git
SourceTree is a fantastic full featured GUI
client for Git
It surfaces all the major git commands as large
buttons so that there is no effort to use Git on a
day to day basis.
It also gives great visuals on the history of a Git
repository to help find that pesky commit you
are looking for
Now its time for some tricks?
git diff --name-status master..branch
finds the differences between two named
git log --pretty=oneline
gives one line log history that looks great
git stash - will save all uncommited changes
into the git local repository. you can git stash
pop to get these changes back at any time.
git checkout -b branchname hash
lets you create and switch to a new branch
with the HEAD placed at the commit referenced
by the hash
Links for more knowledge
Quick link to the free git book
All the rest are from the Git book, www.git-scm.com/book
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.