git alias with bash conditional logic comparing strings - syntax issues -


i'm working on git alias , have run syntax issues @ current (incomplete) state:

[alias] gup2 = !git checkout $1 && before=$(git stash list) && git stash save gup-temporary-stash && git fetch && git rebase -p origin/$1 && if [ "$before" != "$(git stash list)" ]; git stash pop; fi 

the problem seems start when double quotes introduced. i've tried many combinations of single quotes , double quotes escape sequences, can't seem find right combination.

what syntactically correct way form above alias?

after a year of using git alias, decided not worth trouble. in mind, benefit of using alias can put

git foo 

instead of

git-foo.sh 

and in fact if script named example here, can call as

git foo.sh 

or if name script git-foo can call as

git foo 

completely eliminating benefit of git alias in opinion. git syntax scripting crap compared writing external script, i have done.


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -