开发者

restricting git-svn activity to a single git branch

开发者 https://www.devze.com 2022-12-13 18:35 出处:网络
I\'m using git-svn to work with an svn repository. I have my git master branch tracking svn, and several local g开发者_如何学Cit branches. Is there any way to set up things so that if I run git svn re

I'm using git-svn to work with an svn repository. I have my git master branch tracking svn, and several local g开发者_如何学Cit branches. Is there any way to set up things so that if I run git svn rebase or git svn dcommit on a git branch other than master it will simply do nothing?


Scripting to the rescue!

Create a shell script:

curBranch() {
    r=$(git symbolic-ref HEAD)
    echo ${r##refs/heads/}
}

[ "master" == "$(curBranch)" ] || exit 0

git svn "$@"

and run it with your chosen git-svn subcommand as an argument.

0

精彩评论

暂无评论...
验证码 换一张
取 消