Git flow for working on svn branch

July 25, 2011 by
Filed under: git 

The Problem: you want to play on git code branches on svn server. Here’s the simple flow.

1. Specify the layout when running git svn clone:

Specify the trunk, branch and tags by -T,-b,-t, such as: -T dev -b branches -t tags

2. To fetch all updates of all svn server branches:

git svn fetch

When you run git svn fetch, all branches will be updated, and new branches on the remote will be added. git svn fetch fetches the updates with out modifying the local working files (while git svn rebase would).

3. To show all branches include server branches:

git branch -r

4. To switch to work on a server branch: server-branch-v2.8

git checkout -b local-v2.8 server-branch-v2.8 then working on the local-2.8 branch, and commit, dcommit, your changes would be dcommitted to the server branch.

Digg This
Reddit This
Stumble Now!
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)


Comments are closed.