Git philosophy is miles away from CVS, so I suggest you to act differently here. Your Git repositories will be distributed, every developper or server will have a copy of it, with one being authoritative among these (origin
remote in Git terms).
When you want to start a build from a fresh checkout, you first say Git to grab the latest changes from origin
, this is called a fetch.
git fetch origin
Then, to have a fresh checkout, you want your filesystem to be exactly the same as the server version, without any other file.
git checkout --force origin/master
git clean -d --force
The advantage here is that the network operation is very efficient, you grab only the latest diffs from the server you want to sync with, and you're still sure that you're building from the right files, without them being changed.
You'll want to check also tools for Continuous Integration, like Jenkins, which quite well integrated with Git repositories.