1

I transferred my gist and all its revisions into a git repo thanks to this great Github import feature.

But now all the commit messages are empty:

No commit message
UserA committed on GitHub 27 days ago

How to change the commit message of all these 9 or 10 commits, one month later?

(Is it possible directly in Github's website?)

1
  • You will have to rewrite the history of those commits in your branch. Is anyone else sharing this branch? Commented Jan 11, 2017 at 10:42

1 Answer 1

1

Well you can use git rebase -i HEAD^8 to interactivly change the messages. This will open an editor and you can change the commit messages and you change the word pick to reword and can now reword every single commit message. Be aware that this action rewrites your whole history which means you have to do git push --force to update the remote repository.

By doing git push --force you will update the remote history as well, which means that contributer have to re-pull or even re-clone the repository to integrate the new history which can lead to horrible merges or even loss of changes.

Sign up to request clarification or add additional context in comments.

12 Comments

Complementary note: if you don't understand what git push --force does, you should at least know that this is a potentially dangerous operation, don't run it blindly.
Thanks for your comment, I will update the answer and add your information respectivly.
How to do this for all commits? should I do git rebase -i <numberofcommit> ?
Something else: in the editor (is it a vim?) what should I write to rename to "First commit"? I tried rFirst commit (r for reword) then ESC then :wq, but then I get Unknown command: rFirst commit.
You can also start a new branch at the current tip to hold your old version, and do the interactive rebase to update the messages, and then do a rename to swap over the branches, though that maybe more phaff than it's worth.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.