KEMBAR78
From svn to git | PPTX
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 you@yourdomain.example.com
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>
OR
git 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/

From svn to git

  • 1.
    from svn togit checkout svn; commit git
  • 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 Topull 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: gitconfig --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 tothe 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 froma branch: git merge <branch> To rebase from a branch: git rebase <branch> Image from http://codingdomain.com/git/rebase/
  • 10.
    pull requests Image fromhttps://www.atlassian.com/git/workflows#!pull- request
  • 11.
    references & learning GitBasics 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/