Why git commit doesn't recognize --amend on git Windows?

I am trying to follow the suggestion Can you GPG sign old commits?

λ git rebase --exec 'git commit --amend --no-edit -n -S' -i develop

But getting

error: unknown option `amend'

I am running git version 2.23.0.windows.1

1

1 Answer

With the use of λ in the prompt string I guess you're using cmder as the terminal with cmd as the shell. In cmd single quotes aren't the quoting symbol so the exec string isn't passed as a single parameter. You need to change to double quotes:

git rebase --exec "git commit --amend --no-edit -n -S" -i develop

Or better change to powershell or other shells (you should already have bash if you install git on Windows). They recognize ' as the quote character so you don't need to change anything, and you get more features

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like