我如何告诉git-svn关于在获取回购后创建的远程分支? [英] How do I tell git-svn about a remote branch created after I fetched the repo?

查看:129
本文介绍了我如何告诉git-svn关于在获取回购后创建的远程分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 git-svn 来处理我公司的中央 svn 存储库。我们最近在中央回购中创建了一个新的功能分支。我该如何告诉 git ?当我运行 git branch -r 时,我只能看到当我对<$ c运行 fetch 时存在的分支$ c> svn 回购初​​始化我的 git 回购?

I'm using git-svn to work against my company's central svn repository. We've recently created a new feature branch in the central repo. How do I tell git about it? When I run git branch -r I can only see the branches that existed when I ran fetch against the svn repo to initialize my git repo?

推荐答案

您可以手动添加远程分支,

You can manually add the remote branch,

git config --add svn-remote.newbranch.url https://svn/path_to_newbranch/
git config --add svn-remote.newbranch.fetch :refs/remotes/newbranch
git svn fetch newbranch [-r<rev>]
git checkout -b local-newbranch -t newbranch
git svn rebase newbranch

这篇关于我如何告诉git-svn关于在获取回购后创建的远程分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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