如何判断哪个远程svn分支是本地git分支跟踪?
我对如何从不同的本地 git 分支提交多个 svn 分支有点困惑。特别是,尽管我已经阅读了有关该主题的许多相关问题,但到目前为止似乎没有人解释过一件具体的事情:
如果我已经有一些本地分支,我如何知道哪个远程 svn他们正在跟踪的分支(如果有)?
来自 这个答案似乎你可以更改你想要跟踪的分支,但是如何查询它呢?
gitbranch -v 似乎对此没有特别帮助(即没有给出附加信息)。我还查看了 .git/
中的所有文本文件,但也找不到任何内容。
I'm a bit confused about how to commit on several svn branches from different local git branches. In particular, even though I've read many of the relates questions on this topic, there's one specific thing that nobody seems to have explained so far:
if I already have a few local branches, how can I tell which remote svn branch they are tracking (if any)?
From this answer it seems that you can change the branch you want to be tracking, but how to query it?
git branch -v
doesn't seem to be particularly helpful in this (i.e. no additional information is given). I've also looked into all textual files in .git/
but couldn't find anything in there as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
git svn info
为您提供完整的存储库 URL,因此 SVN 分支应该出现在此处。git svn info
gives you the full repository URL, so the SVN branch should appear there.不确定,但 .git/config 中的类似内容可能对您有帮助吗?
Not sure, but may be smth like this in .git/config helps you?
这并不完全符合您的要求,但您可以使用 git remote show $REMOTE_NAME 获取基本信息,其中
REMOTE_NAME 是 svn 存储库的远程名称。这应该显示大量有关正在发生的事情的信息。
It's not exactly what you asked, but you can get the basic info by using
git remote show $REMOTE_NAME
whereREMOTE_NAME
is the name of the remote for your svn repo. This should show a TON of info about what is going where.现在我正在使用
我还希望通过“gitbranch-av”或“gitremote-v”等命令以及可能的一些额外标志来查看它。
For now I'm using
I also would like to see it with commands like "git branch -av" or "git remote -v" plus potentially some extra flag.
你可以尝试:
You could try with: