I picked up a git alias online that is supposed to be the command git rebase -i HEAD~$1
where $1
is a number passed to the alias. Here is the git alias I've got setup in my .zshrc
file:
alias grn="! sh -c \"git rebase -i HEAD~$1\" -"
Example usage from the terminal:
$ grn 3 // This should translate to git rebase -i HEAD~3
The issue i'm running into is that the passed integer argument (e.g. 3
), is not being passed to my alias so the git alias is effectively always running git rebase -i HEAD~
.
Any clues on how to fix this alias?