如何让 git-svn 使用特定的 svn 分支作为远程存储库? [英] How do I make git-svn use a particular svn branch as the remote repository?

查看:29
本文介绍了如何让 git-svn 使用特定的 svn 分支作为远程存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告:一般来说,我是 git 的 n00b.我的团队在 svn 中使用功能分支,我想使用 git-svn 来跟踪我在特定功能分支上的工作.我一直(大致)关注 Andy Delcambre 的帖子设置我的本地 git 存储库,但这些说明似乎导致 git 选择最近更改为远程的 svn 分支存储库;问题是那不是我关心的分支.如何控制 git-svn 使用哪个分支?还是我的做法完全错误?

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?

更新:我确实使用了 -T-b-t 选项(在我的例子中是因为 svn 存储库有多个项目,但我希望 git 存储库只包含我正在处理的项目.

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).

推荐答案

非常感谢 Bart 的博客以获得这个方便的 git 中 svn 分支的参考.显然,我只需要在创建 git 分支时指定一个远程分支,例如,

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.,

git checkout -b git-topic-branch-foo foo

其中 foo 是远程分支的名称.

where foo is the name of the remote branch.

这篇关于如何让 git-svn 使用特定的 svn 分支作为远程存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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