How to add a file to the last local commit?

Sometimes I forget to add some files before committing. With Mercurial, I fix this as follows:

  • hg qinit
  • Convert commit to fix
  • Patch update
  • Convert Patch for Fixation

Can I do something like this using Git?

+4
source share
1 answer

Basically you are trying to change your last commit in Git. It is possible and quite simple.

git commit --amend used for this purpose.

The following page provides a detailed example.

https://github.com/abhikp/git-test/wiki/Changing-your-last-commit

+2
source

Source: https://habr.com/ru/post/1654980/


All Articles