git
   or: how I learned to stop
worrying and love source control
why you should
    care
Traditional version control
systems have deficiencies
Subversion, Perforce, CVS, TFS...
OH, T
SLOW          HE PA
TREE CONFLICTS       IN!
MERGING IS CHALLENGING
BRANCHES ARE JUST COPIES
using svn
using git
git   is awesome
It’s distributed!
Distributed Version Control System
Every repository is equal.
You can work offline.
Fast as lightning.
add    status   diff     log   commit   branch




      git         mercurial        bazaar
Very efficient.

git clone rails - 53 seconds
40mb, 2356 files, 29045 commits
Great branching and merging.
Any workflow you want,
you got it...
Shared repository
Linus Torvalds   Blessed repository




Lieutenants


Developers
how to   install
Linux:
     apt-get install git-core
Mac OS X:
     brew install git
Windows:
     chocolatey install msysgit
Download from git-scm.com
getting
started
git config --global user.name ...
git config --global user.email ...
git init
master has no special meaning.
It’s just a default branch.
git add
Staging area stores info about
what will go into next commit.
working
               staging area        repository
directory
            checkout the project

       stage files

                        commit
git commit
Commit “name” is a 40-digit SHA
189f30b664981e4397625791c8ea3bbb5f2279a3
commit       189f30b...
   tree          e8455...
parent(s)           nil
  author Mindaugas...
committer Mindaugas...
      Initial commit
tree    e8455...
blob      bc52a... README.md
blob   bc52a...
SVN, CVS, Perforce store
differences between commits.
Git stores snapshots.
commit0   commit1   commit2
 tree0     tree1     tree2
blob A    blob A    blob A2
 blob B   blob B2   blob B2
Basic
training
complete.
pushing
    and
   pulling
git remote add origin git@git...
git push origin master
git pull origin master
branching
  and merging
git branch name
Branch is a reference to the
head of a line of work.
master

C0     C1

     feature
git checkout name
git merge name
master

C0   C1         C2

          F1            F2

                     feature
master

C0   C1        C2             C3

          F1          F2

                    feature
git rebase name
master

C0   C1         C2

          F1            F2

                     feature
master

C0   C1   F1     F2       C2

               feature
merge is fine, but in a lot of
cases, rebase is better.
Branching - too easy not to do
manipulating
history
git commit --amend
git rebase --interactive
Interactive rebase lets you:
reword, edit, squash, fixup,
exec, remove and reorder.
Be carefu
                                    l!
You can change history of remote
repository with git push --force.
Rewriting
history is fun
and useful!
git-   svn
git svn clone http://...
git svn rebase ~ svn update
git svn dcommit ~ svn commit
GitHub
The best way to collaborate.
More than
 1.6 million people,
 2.8 million repositories.
Used by individuals.
And organizations.
closing
    thoughts
blame bisect cherry-pick clean
cvsimport describe diff fetch
filter-branch grep request-pull
revert svnimport stash
submodule tag and more...
RES
git-scm.com     OUR
gitready.com       CES
gitimmersion.com
ontwik.com/category/git-github
Git != Subversion + Magic
The slogan of Subversion for a
while was "CVS done right". If you
start with that kind of slogan,
there's nowhere you can go. There
is no way to do CVS right.
            Linus Torvalds
thanks to:
Zach Holman @holman
thenounproject.com
thanks!
codingfearlessly.com
twitter.com/mmozuras
github.com/mmozuras

M.Mozūras - git