Reputation: 6964
Assuming we have a git commit history which looks like:
ZZ [origin/master] A -> B -> C -> D -> E [master]
We want to:
A
.E
.A..E
in to a single commit.The result should look like:
ZZ -> XX [master][origin/master]
Where XX is the commit encompassing the changes of prior commits A..E
Upvotes: 1
Views: 476
Reputation: 8534
You can try:
git reset --hard E
git reset --soft ZZ
git commit 'comment'
git push orgin master
--soft
Does not touch the index file nor the working tree at all (but resets the head to , just likeall modes do). This leaves all your changed files "Changes to be committed", as git status would putit.
Upvotes: 3