如何让 git-svn 使用特定的 svn 分支作为远程存储库?
警告一句:总的来说,我对 git
很陌生。 我的团队在 svn 中使用功能分支,我想使用 git-svn 来跟踪我在特定功能分支上的工作。 我一直(大致)关注Andy Delcambre 的帖子设置我的本地 git 存储库,但这些指令似乎导致 git 选择最近更改的 svn 分支作为远程分支存储库; 问题是那不是我关心的分支。 如何控制 git-svn 使用哪个分支? 或者我的做法完全错误?
更新:我确实使用了 -T
、-b
和 -t
选项(在我的例子中,因为 svn
> 存储库有多个项目,但我希望 git 存储库仅包含我正在处理的项目)。
A word of warning: I'm a n00b to git
in general. My team uses feature branches in svn
, and I'd like to use git-svn
to track my work on a particular feature branch. I've been (roughly) following Andy Delcambre's post to set up my local git
repo, but those instructions seem to have led git
to pick the svn
branch that had changed most recently as the remote repository; the problem is that's not the branch I care about. How do I control which branch git-svn
uses? Or am I approaching this completely wrong?
UPDATE: I did use the -T
, -b
, and -t
options (in my case because the svn
repo has multiple projects, but I want the git
repo to contain only the project I'm working on).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
感谢 Bart 的博客提供了这个方便的 git 中 svn 分支的参考。 显然,我所需要的只是在创建 git 分支时指定一个远程分支,例如,
其中 foo 是远程分支的名称。
Muchas gracias to Bart's Blog for this handy reference for svn branches in git. Apparently all I needed was to specify a remote branch when creating the
git
branch, e.g.,where
foo
is the name of the remote branch.您也可以看看这个: git-svn 是一种门户毒品 - robby on Rails。
当我需要确保我的本地分支指向正确的远程 svn 分支时,我使用了类似的方法:
获取我想要跟踪的远程分支的名称。 然后
显式更改我的本地分支以指向不同的远程分支。
You might also have a look at this: git-svn is a gateway drug - robby on rails.
I used something like this when I needed to make sure that my local branch was pointing to the correct remote svn branch:
to get the name of the remote branch I want to be tracking. Then
to explicitly change my local branch to point to a different remote branch.
我需要首先运行“git svn fetch”,因为我想要关联的分支是在我的 git 客户端之后创建的。
I needed to run 'git svn fetch' first, since the branch I wanted to associate with had been created after my git client.
我使用 git-svn 但没有使用与 SVN 分支互操作的功能。 话虽如此,我注意到您所遵循的教程没有使用 -T, -b , -t git svn init 的选项。 这些选项告诉 git-svn 上游 trunk/branches/tags 目录的名称,这在您的情况下可能很重要。
I use git-svn but I haven't used the features that interoperate with SVN branches. Having said that, I notice that the tutorial you were following didn't use the -T, -b, -t options to git svn init. These options tell git-svn what the upstream trunk/branches/tags directories are named, which might be important in your situation.