Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)

Is there any way of online editing the commit message in GitHub.com, after submission?

From the command line, one can do

git commit --amend -m "New commit message"

as correctly suggested in another question.

Trying git pull and then git push has worked (without any other commit having interfered in the mean time).

But can it be done via the GitHub website?

1 Answer

0 votes
by (27.5k points)

No, this is not directly possible. For every Git commit the hash is also calculated based on the commit message. Remember that changing the commit message will change the commit hash. In case you want to push that commit, you have to force that push (git push -f).

Keep in mind that if other developers in your already pulled the old commit and started to work based on that commit, then they would have to rebase his work onto your new commit.

Browse Categories

...