getting started with git svn
DESCRIPTION
Getting started with git svnTRANSCRIPT
Getting started with git-svn
Manij Shrestha
Who?● Git user who needs to work on project that uses SVN
● SVN users who wants to learn Git
● Because you can
Why?● Able to work on multiple branches from same project directory.
● No need to be on VPN to pull the revision history.
● Local branches, Stashing, local commits
How?$ git svn clone svn://internal-repo/Project Project -s
(-s == Standard model, trunk, branches, tags)
OR
$ git svn clone svn://internal-repo/Project Project --trunk=trunk --branches=maintenance/* --prefix=git-svn/
prefix must trail with “/”
OR
$ git svn init svn://internal-repo/Project Project --trunk=trunk --branches=maintenance/* --prefix=git-svn/
$ git svn fetch
Taking a look @ .git/config
SVN:
GIT:
SVN
Pulling selective branch.If you only want to pull few branches.Edit “.git/config”Add branch name(s), inside “{}”
$ git svn fetch
SVN
Getting Latest Code
$ git svn rebase
Not “git pull”
commit$ git svn rebase (similar to ‘git pull’/ ‘svn update’, will rewind your changes and applies your changes on top)$ git svn dcommit
Each “git commit” will be checked in as separate revision in SVN. SVN
Working on branch$ git checkout -b branch2 refs/remotes/git-svn/branch2
Don’t forget the refs/
You can now commit and dcommit on this branch
● Merge is not recommended (Tree conflicts, commit to wrong branch). Merge branches in SVN.
Linear historyAlways have a linear history.
SVN GIT
LOST
Summarygit svn initreview .git/configgit svn fetchgit commit.. commit.. commit..git svn rebasegit svn dcommitgit stash… git branch..Linear History...