How can I create a bash or zsh alias for git commit, git pull, git push and pull on a remote server? <p>If I type the following into Terminal I can accomplish everything I want:</p> <pre><code>git commit -am "my commit message" ; git pull ; git push ; ssh user@server 'cd /path/to/git/repo/ ; git pull ; exit' </code></pre> <p>I'd like to create the same as an alias in my <code>~/.zshrc</code>. Something like:</p> <pre><code>alias pushit () { git commit -am "$@" ; git pull ; git push ; ssh user@server 'cd /path/to/git/repo/ ; git pull ; exit' } </code></pre> <p>To be run in Terminal like so:</p> <pre><code>pushit "my commit message" </code></pre> <p>Instead every time I reload ~/.zshrc (<code>source ~/.zshrc</code>) or open a new Terminal window I see it loop through my alias dozens of times. It's not clear it actually runs.</p> <p>What am I doing wrong?</p> <p><strong>Notes:</strong></p> <ol> <li>This is not for a mission critical server. It's just for personal use. I know it's poor form.</li> <li>I'd rather not use git's [alias] tools so I can keep all of my aliases in the same place (<code>~/.zshrc</code>).</li> </ol>