Reputation: 6581
I have a git repo of the Linux kernel. I made it with the standard git clone. Lets call that repo 'server'. I also have 'computer a' which did a clone of server. I developed on 'computer a' for a long time, then pushed back to 'server', but always in a separate branch. After some time I wanted to update server, so I ran the following on 'computer a'
git checkout master
git pull git://linus/kernel.git
git push origin master #here origin is 'server'
So now my server's main branch could have changes in master that aren't from the main kernel repo. How can I find them, if any? In other words, how can I verify that the entire history in server/master is identical to Linus' master branch?
thanks
Upvotes: 2
Views: 90
Reputation: 992737
Git makes it easy to verify that the entire history of two branches is the same:
The git cherry command can help to identify commits that are not in the upstream branch, if the hashes are different.
Another tip is to use git pull --ff-only
if you're pulling from an upstream branch and want to make sure that a merge with local work is not done. After using --ff-only
, either the SHA1 commit IDs will match, or the whole command will fail.
Upvotes: 1