Git commit --amend without asking for message

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

From time to time I find myself commit-amending using the same message.

Typically, I do:

    • Add my changes to staging area.
    • Do git commit --amend.
    • Wait for the text editor to open.
    • Save and close it (without changing the message).

There is anyway to tell git that I don t want to change the commit message (skipping the step of opening my text editor and saving the message)? Like:

    • Add my changes to staging area.
    • Tell git to amend my staging area to the last commit without asking me for another message.

I know I can avoid git firing up my text editor by doing git commit --amend -m "<message>". But this way I would have to retype the message.

Answers

Try git commit --amend --no-edit.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/15479609/git-commit-amend-without-asking-for-message

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils