title: git alias with bash conditional logic comparing strings - syntax issues
body: <p>I'm working on a git alias and have run into syntax issues at its current (incomplete) state:</p>
  
  <pre><code>[alias]
  gup2 = !git checkout $1 &amp;&amp; BEFORE=$(git stash list) &amp;&amp; git stash save gup-temporary-stash &amp;&amp; git fetch &amp;&amp; git rebase -p origin/$1 &amp;&amp; if [ "$BEFORE" != "$(git stash list)" ]; then git stash pop; fi
  </code></pre>
  
  <p>The problem seems to start when the double quotes are introduced. I've tried many combinations of single quotes and double quotes with escape sequences, but I can't seem to find the right combination. </p>
  
  <p>What is the syntactically correct way to form the above alias?</p>