I set up a git alias like this:
git config --global alias.popmerge '!git stash pop && git merge master'
Then I call it, like this:
git popmerge
The "git stash pop" is executed, but the "git merge master" is ignored.
If I run "git merge master" right after the "git popmerge"... it sumply runs as expected, performing the merge.
I have other aliases with long sequences of commands... and they run flawlessly. It seems something at "git stash pop" makes the alias process to halt... Is it possible to avoid this behavior? How?
Thanks.
stash pop
and then do amerge
? Wouldn't it be safer to first do themerge
, thenpop
? Also, I am not sure ignoring the exit status, accepted as an answer, is really desirable. Doesn't failure instash pop
mean, there were conflicts? Do you really want to increase the mess doing another conflict-pronemerge
? – Erlangerstash save / stash pop
purpose is ONLY to allow thecheckout master
command in this sequence to be always successfull. I want the stash stack to be empty, and thestash pop
to be always successfull. The exit status of a successfullstash pop
is not zero. Don't ask me why. That's why I needed the;
workaround. Consider the chances of conflict coming from apop
immediately aftersave
: it is zero, in this context. – Apograph