开发者

restricting git-svn activity to a single git branch

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜