Reputation: 14856
branch A
|
| branch B
| |
|/
|
commit X
|
|
...
How do I edit commit X to become X' such that both A and B have X' in their history? (All commits and branches are local.)
Upvotes: 0
Views: 211
Reputation: 30204
You have to rewrite branches history (with all its implications):
git checkout x
# do changes
git add .
git commit --amend
# now we have X'... let's create a temp branch here
git branch temp
git rebase --onto temp x A # rebase branch A onto temp
git rebase --onto temp x B # rebase branch B onto temp
Now, you could delete temp
git branch -d temp
Upvotes: 4