Upload
nehal-shah
View
80
Download
1
Embed Size (px)
Citation preview
from svn to git
checkout svn; commit git
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/
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
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.
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
committing
Be sure to:
git config --global user.name "Your Name Comes Here"
git config --global user.email [email protected]
Then:git add .
git commit -m "A descriptive and useful message."
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
branching/tagging
To branch:git branch <branch_name>
git checkout <branch_name>
ORgit checkout -b <branch_name>
To Tag:git tag -a <tag>
Image from http://nvie.com/posts/a-successful-git-branching-model/
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/
pull requests
Image from https://www.atlassian.com/git/workflows#!pull-
request
references & learning
Git Basics
http://git-scm.com/book/en/Getting-Started-Git-Basics
Git - SVN Crash Course
http://git-scm.com/course/svn.html
Code School - Try Git
https://try.github.io
Learn Branching
http://pcottle.github.io/learnGitBranching/