tags:

views:

19

answers:

1

I want to enforce (i.e. throw an error and fail) whenever I do a git merge with staged changes. Much in the same why a git rebase will not work if unstaged changes exist. Is there a way to do this?

The goal of this is to enforce a workflow like:

git stash
git pull #or git merge
git pop
+1  A: 

Try git config branch.autosetuprebase true and git config branch.<name>.rebase true (where is any existing branch name). This would default pull to use --rebase.

note: just like any merge/rebase, this may have conflict. The git config manual page activally warn against this option.

J-16 SDiZ