Commanding Chaos for Coworking, Open Source and Creative Communities

git ready » push to only bare repositories

Fri, 02/17/2012 - 05:54 -- rprice

Make git behave more like svn or a centralized repo on the server. Good advice.

There’s easy ways to share your changes with Git, but sometimes you want to push and pull from a repository instead. The best practice here is when you want to push changes, don’t push to a non-bare repository. In other words, from the GitFaq:
A quick rule of thumb is to never push into a repository that has a work tree attached to it, until you know what you are doing.
The lesson here is that if you’re going to push changes, make a bare repository clone with git clone --bare. From this point, you could host the changes from with git daemon so others can access them.