I'm working on a Python/Git project for a Udacity program, and I've been told that my commit messages need to be fixed to obey the Udacity format (was indicated to be "encouraged" and not "required", but okay). However, I'm having trouble with replacing the existing commit messages using the git rebase
command.
I tried using the suggestion from gitHub docs, using git rebase -i HEAD~13
(to modify all my commits), and then in the initial rebase prompt, I change each of the commit lines from pick
to reword
and then go through the process of placing in the new commit messages. However, at the end, what happens is I have 13 new commits added on to my branch, each of which have the new commit messages. The existing commits remain the same.
I then tried using this solution from StackOverflow which involves using git rebase
and setting each commit to edit
instead, and using git commit --amend
to modify the last commit and then using git rebase --continue
to advance to the next, slowly modifying each commit as being "most recent", one by one with --amend
. In this case, it also added a series of new commits to the branch, without actually editing the old ones.
Could this maybe be because I've already pushed my branches to origin on gitHub? Or because my branches are merged already? Apologies if this is a stupid question, but I couldn't find any results on Google for this particular problem besides more instructions to do what I've already done.
My repository: https://github.com/WJTownsend/pdsnd_github