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.
Have you checked the exit code from stash pop?
&&
implies that the subsequent list is only executed if the exitcode is 0 (success).
You can simply ignore the exitcode by using ;
instead of &&
.
Verify the success by using stuff like:
true && echo ok || echo fail # echoes "ok"
false && echo ok || echo fail # echoes "fail"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With