title: How can I add this lengthy command as alias on git?
body: <p>I sometimes use this command on git.</p>
  
  <pre><code>$ git filter-branch --commit-filter '
      if [ "$GIT_AUTHOR_EMAIL" = "wrong@address.local" ];
      then
              GIT_AUTHOR_NAME="myname";
              GIT_AUTHOR_EMAIL="right@address.com";
              git commit-tree "$@";
      else
              git commit-tree "$@";
      fi' HEAD
  </code></pre>
  
  <p>I want to add that as alias.
  And then I tried as below, it doesn't work...</p>
  
  <pre><code>git config --global alias.rewritelog '!f(){ \
      git filter-branch --commit-filter \' \
      if [ "$GIT_AUTHOR_EMAIL" = "wrong@address.local" ]; \
      then \
          GIT_AUTHOR_NAME="myname"; \
          GIT_AUTHOR_EMAIL="right@address.com"; \
          git commit-tree "$@"; \
      else \
          git commit-tree "$@"; \
      fi\' HEAD \
  };f'
  </code></pre>
  
  <p>After this command, error occurred.</p>
  
  <pre><code>zsh: parse error near `then'
  </code></pre>