11
from svn to git checkout svn; commit git

From svn to git

Embed Size (px)

Citation preview

Page 1: From svn to git

from svn to git

checkout svn; commit git

Page 2: From svn to 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/

Page 3: From svn to git

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

Page 4: From svn to git

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.

Page 5: From svn to git

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

Page 6: From svn to git

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."

Page 7: From svn to git

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

Page 8: From svn to git

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/

Page 9: From svn to git

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/

Page 10: From svn to git

pull requests

Image from https://www.atlassian.com/git/workflows#!pull-

request

Page 11: From svn to git

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/