Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
567 views
in Technique[技术] by (71.8m points)

git svn - Git-svn: create & push a new branch/tag?

After cloning an SVN repository using git-svn with the -s option (git svn clone http://server/repo -s), how does one create a branch or tag and have pushed to the relevant branch/tag directory in the repository when dcommiting?

For instance; if I were to use git to create a foobar branch locally (git checkout -b foobar) how can I have git-svn create the branch on the server (http://server/repo/branches/foobar)?

I'm using Git 1.5.5.6.


Please Note:

The accepted method below does not work with Git 1.5.5.6 as there is no git svn branch method. I'm still looking for a solution to this that doesn't involve resolving to working with svn directly.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can read all the nitty-gritty details in this tutorial, but the gist is basically the following:

$ git svn branch -m "Topic branch" my_topic            # Create SVN branch called "my_topic"
$ git checkout --track -b my-topic remotes/my_topic    # Create the Git branch for "my_topic"
# Hack hack hack...
$ git svn dcommit --dry-run    # Make sure you're committing to the right SVN branch
$ git svn dcommit              # Commit changes to "my_topic" branch in SVN

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...