2. svn = remote
git = local
While with svn,
everything routes
through the remote
repository, git
introduces the notion of
a “local” repository
Image from http://techidiocy.com/understand-git-clone-command-svn-checkout-vs-git-
clone/
3. svn = URL => <root>
git = URL => repository
Branching/tagging are
an inherent part of git
trunk => master
Image from http://www.mactech.com/articles/mactech/Vol.22/22.11/2211XCode/index.html
4. svn = files
git = changesets
Image from https://jazz.net/forum/questions/133603/how-to-create-remote-change-setswith-external-
link
With svn, you commit
whole files. svn
diff is a diff of the
two versions of a file.
With git, the diff IS
what you commit.
5. cloning & pulling
To pull down a project
from the remote repo:
git clone <repo_URL>
Then update with:
git pull
vs.
git fetch/merge
Remote
Repository
Local
Repository
Working
Directory
git fetch
git merge
git pull
6. committing
Be sure to:
git config --global user.name "Your Name Comes Here"
git config --global user.email you@yourdomain.example.com
Then:
git add .
git commit -m "A descriptive and useful message."
7. pushing
To push to the existing
remote origin:
git push
To create a new remote
origin:
git push -u origin
<branch_name>
Remote
Repository
Local
Repository
Working
Directory
git push
git commit
8. branching/tagging
To branch:
git branch <branch_name>
git checkout <branch_name>
OR
git checkout -b <branch_name>
To Tag:
git tag -a <tag>
Image from http://nvie.com/posts/a-successful-git-branching-model/
9. merging/rebasing
To merge from a
branch:
git merge <branch>
To rebase from a
branch:
git rebase <branch>
Image from http://codingdomain.com/git/rebase/