git: minimize uploaded git files

Rather than uploading every checked-out file of a repository and the
repository objects themselves, skip the checkout and instruct git to compact
before upload. The result is that only a handful of files are transferred,
rather than hundreds or thousands for large repositories.

The HEAD ref is updated before upload so that a hard reset works as before on
the target. The reflog is also disabled in order to avoid uploading useless log
files.

This change is backwards-compatible, but it will only have an effect on new
repositories.
Merge pull request #71 from theuni/cache

cache: define variables for cache paths
Merge pull request #72 from theuni/git-minimize-upload

git: minimize uploaded git files
cache: define cache paths and GBUILD_CACHE_ENABLED only if caching is enabled