I wanted to reword my commit messages. I used git rebase --interactive, and used reword to alter commit messages. My expectations were that my tree will remain exactly the same, but with different commit messages. Instead, I ended up with 2 trees, one containing the original messages, one reworded ones.
I've edited the tree below to remove complexity, so maybe it is not a truest representation of where things went wrong, and why, but it is a clear representation of what I have right now. Notice that there are 4 messages the are the essentially the same, but are slightly reworded. I assure you that deltas are the same.
* 56bb877 (HEAD, bjyGuardProvider) BjyRuleAdapter: checkpoint! (same as 0e1f985)
* 6b765f1 Base: Added a new FedcoUser local module (same as 47e1cf9)
* bbfb764 Base: Added Zend Studio/Server deployment descriptor files (same as 6b7cc21)
* 8ee08b9 General: Added vendor modules (no configuration applied) (same as 4648e11)
| * 0e1f985 (origin/bjy, bjy) Checkpoint: BjyAuthorize works
| * 47e1cf9 Added a new FedcoUser local module
| * 6b7cc21 Added Zend Studio/Server deployment descriptor files
| * 4648e11 Added vendor modules (no configuration applied)
|/
* e539e7a Initial ZendSkeletonApplication
How do I fix this?
If it absolutely will help, I can put a link to the full tree somewhere, or provide any other info.
Did you do some
pullorfetchandmergeafterwards? The tree looks like this.After rewriting your history with
git rebasethe names (hashes) of the first commit and all following commits will change, which causesgit pushto fail it--forceis not specified.pulling new commits afterwards will reintroduce all the commits that should be changed.To fix your branch you can
rebaseagain, do aforced pushand remember to never ever rewritepushed branches again!