I am using Zsh with iTerm2 and trying to follow these instructions to remove a commit that I accidentally pushed to a repo (don't worry, it doesn't have any followers other than me).
Running the command
git push -f origin HEAD^:develop
causes an error in Zsh
error: src refspec HEADER does not match any.
error: failed to push some refs to 'git@github.com:xxx/yyy.git'
There is a file named HEADER
in this directory, so I am thinking Zsh or iTerm is trying to be smart by doing some completion with ^
.
I did the same push command in Terminal.app (which still uses /bin/sh
) and it worked.
What is this Zsh/iTerm behavior and how can I control it?