Adding to past commits

Consider the following scenario:

I have a project where all the past commits in it are fixup commits, now I’m starting to add things, so I want to add a fixup tag to the past commits.

How can I do it?

Hello and welcome to the community!

I’m not sure I understand. Creating a fixup commit is one step in a two-step process: creating the fixup commit and rebasing the branch to squash the fixup commit and the fixup target. So are you saying that all previous commits in the repository were fixup commits that were never rebased? Or are you saying that you want to treat all previous commits in the repository as fixup commits so they can all be squashed into one commit?

Thanks for the fast reaction,

I want to change all the previous commits to allow easier reading,

for example a commit like that: commit number one

will be changed to commit number one - fixup

is it possible?

If what you’re looking to do is to add a single word to every commit message in the entire repo, then yes, there are tools for that. The one built in to git is the git filter-branch command which allows you to rewrite the history of an entire branch. You would use the --msg-filter option to rewrite the commit messages.

I hope that helps!

2 Likes