Saturday, November 17, 2012

Configuring a Git server

To publish an HTTP server, I use WebGitNet and the following system configuration:
receive.denynonfastforwards=true
gc.auto=0
core.logallrefupdates=true

receive.denynonfastforwards=true

Prevents people from accidentally pushing (using -force) a non-fast-forward update. This happened to me when I wanted to push a non-fast-forward update, but did not specify the single branch i.e. I used git push -f, which by default pushes all branches using the force flag.

gc.auto=0

There can be a lot of useful information in the 'garbage' of a git repository. My policy is to never delete that garbage.

core.logallrefupdates=true

The reflog is useful, but unfortunately it is not kept for remote bare repositories. This re-enables the reflog.

0 comments:

Post a Comment