Adding to past commits #22696
-
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 How can I do it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
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? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the fast reaction, I want to change all the previous commits to allow easier reading, for example a commit like that: will be changed to is it possible? |
Beta Was this translation helpful? Give feedback.
-
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 I hope that helps! |
Beta Was this translation helpful? Give feedback.
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!