Wednesday, January 16, 2013

git-svn adventures

Checkout:

How to correctly checkout an existing svn repo, following a standard svn layout:

git svn clone http://svnRepoAddress.com/project --stdlayout

verify that you can see branches from svn:

git branch -r

Checkout a branch (notice the appended "Local"):

git checkout -b featureBranchLocal remotes/featureBranch
If you are trying to create a branch, refer to this SO post.

git checkout featureBranchLocal

git svn rebase

How to revert a commit from SVN using git-svn (I recommend doing it in order from HEAD, top-down, haven't tried otherwise but it would seem you would be resolving unnecessary conflicts):

git revert <commitHash>
git revert <commitAnotherHash>
git svn dcommit

SVN should have applications of reverted commits.

Pull down new svn branches: Fetch


git svn fetch 

Credit: SO posts: 1, 2, 3.

No comments:

Post a Comment