Git-svn:创建&推一个新的分支/标签? [英] Git-svn: create & push a new branch/tag?

查看:93
本文介绍了Git-svn:创建&推一个新的分支/标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用git-svn克隆一个SVN仓库并使用 -s 选项( git svn clone http:// server / repo -s ),当 dcommit ing

时,如何创建分支或标记并将其推送到存储库中的相关分支/标记目录?例如,

如果我要用git在本地创建一个 foobar 分支( git checkout -b foobar ),我该如何让git -svn 创建服务器上的分支( http:// server / repo / branches / foobar )?



我正在使用Git 1.5.5.6。
$ b




请注意: 接受的方法不适用于Git 1.5.5.6 ,因为没有 git svn branch 方法。我仍然在寻找一个解决方案,它不涉及解决直接使用svn的问题。 你可以阅读所有这些教程中的基本细节,但要点基本上如下:
$ b $ pre $ $ $ $ $ git svn branch -m主题分支my_topic#创建名为my_topic的SVN分支
$ git checkout --track -b my-topic remotes / my_topic#为my_topic创建Git分支
#破解hack hack ...
$ git svn dcommit --dry-run#确保你提交的是正确的SVN分支
$ git svn dcommit#将更改提交到SVN中的my_topic分支


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.

解决方案

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

这篇关于Git-svn:创建&推一个新的分支/标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆