Edit commit messages in Github.

When you are working in a project and you commit your changes to a repository sometimes you use the commit messages to handle the issues from your Version Control system. You can directly close open issues appending some text to your commit messages and maybe you want to modify this message after commiting because maybe its affecting the wrong issue .
1 answer

Edit commit messages in Github

This article solves the following challenge: 

Edit commit messages in Github.

Typos happen, but luckily in the case of commit messages, it is very easy to fix them:
git commit --amend # start $EDITOR to edit the message
git commit --amend -m "New message" # set the new message directly
But that’s not all git-amend can do for you. Did you forget to add a file? Just add it and amend the previous commit!
git add forgotten_file
git commit --amend
Please keep in mind that --amend actually will create a new commit which replaces the previous one, so don’t use it for modifying commits which already have been pushed to a central repository. An exception to this rule can be made if you are absolutely sure that no other developer has already checked out the previous version and based their own work on it, in which case a forced push (git push --force) may still be ok. The --force option is necessary here since the tree’s history was locally modified which means the push will be rejected by the remote server since no fast-forward merge is possible.

Evaluate complexity of present statement:

Select ratingCancelGuessingPassing knowledgeKnowledgeableExpert

Your rating: None Average: 4 (1 vote)