git-svn workflows: working with svn-branches

19 Jan
git svn clone —stdlayout https://svnserver/repos/my_repo

display info about the svn-connection:


git svn info

display all known branches:


git branch -a

create a local branch tracking an existing branch from SVN (NOTE: for the local branch you have to use a different name than it is called in SVN because otherwise git-svn gets confused when switching branches and will create a new branch in ‘detached HEAD’ state, which means it is not connected to the SVN-branch!)


git checkout -b b_my_branch my_branch

show the new local branch, do something, commit to SVN, switch back to trunk:


git branch -a
echo test > testfile
git add testfile
git commit -m ‘added testfile’
git svn dcommit
git checkout master
git svn info

Leave a Reply

Your email address will not be published. Required fields are marked *