Bulk ammending commit messages in git
At work we have a giant repository with many projects. Each commit is prefixed with the project and suffixed with an internal project number.
Because I do not want to maintain those prefixes and suffixes during development, I ammend my commit messages before rcheckin to CVS.
This blog article from gaffo came in handy:
Bulk ammending commit messages in git
My commands
Prepend and append text to commit messages (from master branch to HEAD):
Prepend text to commit messages (from master branch to HEAD):
Append text to commit messages (from master branch to HEAD):
Tidy up
A little later, I needed the following Stackoverflow articles:
Remove backup branches
git filter-branch
creates backups of the branches before it rewrites them. How to remove that backup?
Remove refs/original/heads/master from git repo after filter-branch –tree-filter?
Sample:
Undo filter-branch
In case git filter-branch
must be undone, a git reset --hard HEAD@{1}
comes to the rescue
Undoing a git rebase (with the help of git reflog
)