How to Modify the Last Git Commit Message

From Terminal into VS Code

Pavol Kutaj
1 min readApr 3, 2021

The aim of this how-to-guide🏁 is to show how to fast edit the last git commit message.

1. steps/?

  • the last commit can be amended just by running git commit --amend
  • first, I am getting
▶ git commit --amend
hint: Waiting for your editor to close the file... "C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\Code.exe" --wait: C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\Code.exe: No such file or directory
error: There was a problem with the editor '"C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\Code.exe" --wait'.
Please supply the message using either -m or -F option.
  • problem is that the path is incorrect
  • run code --version in the same folder as your git repo
  • make sure it works
▶ code --version
1.54.3
2b9aebd5354a3629c3aba0a5f5df49f43d6689f8
x64
  • run git config --global core.editor "code --wait"
  • run git commit --amend
  • VSCode should start and show COMMIT_EDITMSG file

2. sources

--

--

Pavol Kutaj

Today I Learnt | Infrastructure Support Engineer at snowplow.io with a passion for cloud infrastructure/terraform/python/docs. More at https://pavol.kutaj.com