I often work on the same project on several computers. After some time, I need to make sure that the project files are synced and up to date with the latest changes on each computer. So I end up with two directories, A and B, that have the same contents, but the .git files do not match between the two directories, even if their contents are the same. I need to make sure that one directory (A) ends up with everything that B has, so that I can then delete B.
So I need a way to know that directory A/.git contains all the info that B/.git contains, even if the .git/* files do not compare. Here is what I came up with:
(git branch -av;git stash show -v)|md5sum
If I run this in both A and B, I should get the same result if both sides have the same branches and stashes. Is this sufficient to be sure that both repos have the same info? Or am I missing something else?