Martin DeMello
Martin DeMello

Reputation: 12336

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 git 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?

Upvotes: 2

Views: 181

Answers (1)

Wojciech Kaczmarek
Wojciech Kaczmarek

Reputation: 2342

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.

Upvotes: 2

Related Questions