I want to make an alias
to drop a git stash in zsh shell. The stash no. which I want to drop should be passed as an argument to my function call.
I have tried below but it is failing -
function gd() {
if [ -n "$1" ]
then
git stash drop "$1"
else
echo 'Enter stash no to drop'
fi
}
It gives me below error -
fatal: ambiguous argument '0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Seems I am not passing the argument correctly and it is being treated as a string.
How can I make this work?