I noticed that if i do a
git rebase -i HEAD~10
and then don’t change anything in the resulting file, some sort of rebase still gets performed. I.e. I need to
git push origin branch --force
since a regular push
git push origin branch
would apparently lose history!
This seems to imply that some history was changed but i don’t understand why. If i didn’t choose to change any commit (i.e. every commit was picked) then why did the history change and what specifically changed?
If you do a
git log --format=fulleryou’ll see that a commit not only tracks the author, but the committer:When you rebase, your user is listed as the new committer. Here’s an example of what it would look like if I rebased that code block:
So what’s probably happening is that you’re rebasing commits that were made by another person, and it’s changing the commit and CommitDate. Obviously git will see a new hash (because part of the commit’s changed) and note the change.