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.
精彩评论