반응형
git commit --amend without asking for message [duplicate]
This question already has an answer here:
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.
Try git commit --amend --no-edit
.
This will amend the latest commit, using that same message, in one command:
git commit --amend -C HEAD
참고URL : https://stackoverflow.com/questions/15479609/git-commit-amend-without-asking-for-message
반응형
'code' 카테고리의 다른 글
Is it possible to have Methods inside Methods? (0) | 2020.09.21 |
---|---|
Pass parameter from a batch file to a PowerShell script (0) | 2020.09.21 |
Webpack loaders vs plugins; what's the difference? (0) | 2020.09.21 |
git -> show list of files changed in recent commits in a specific directory (0) | 2020.09.21 |
What is the difference between web-crawling and web-scraping? [duplicate] (0) | 2020.09.21 |