You could put a post-receive hook on the bare repos of your git server, in order for that hook to go to a non-bare repo, and pull.
It would keep that way a working tree always up-to-date, commits after commits.
You can see an example in this question.
#!/bin/sh
unset $(git rev-parse --local-env-vars)
cd /path/to/non-bare.repo
git pull
As illustrated in the follow-up question "Can I issue git rev-parse on remote repository without a local copy?", torek mentions:
You can use
git ls-remote
to get the head SHA-1s from the remote (includingrefs/heads/master
).
All that will tell you is "same" or "different", assuming you have the head SHA-1s locally.
If they are different, you can't tell precisely why (though you can get probably-enough if you walk the local revs).Comparing the output of
git ls-remote
andgit rev-parse master
will tell me if my local repo is updated or not.
That can be a way to know when to trigger a git pull
.