Amend Commits (git amend)


      This file relates to both  GitHub and  GitLab.
    

This guide briefly shows you how you can amend any unpushed commits. It is useful if you forgot a single line and do not want to have a new commit for it. Console usage is required
Note: This will only work for the latest commit, other commits will require advanced git use

  1. Stage all file changes you wish to add to the commit by selecting them and clicking either Stage All or Stage Selected
  2. Select the Terminal button
    Amend Commit #1
  3. Execute the following command
    git commit --amend
  4. Update your commit message and save and exit it (In the nano app as shown in the picture below, its Ctrl+O and Ctrl+W)
    Amend Commit #2
  5. You are done!
Demo Video
The following is a video on how this is being done. Read the how-to guide before watching the video for actual steps to do it

Console Commands Used

git commit --amend # Amends the commit