I want to create a git repo on my server to update my website after pushing. The first step of all tutorials(such as this: http://developertheory.com/how-to-auto-deploy-apps
I suspect this tutorial uses git init --bare
as a "clean" way to create an empty repo which cannot be mixed with the actual files:
Such a repo will contain directly the .git
usual content, even after being re-configure as non-bare.
You need a non-bare repo in order for the git checkout
(in the hook) to work, since you can only checkout a branch in a non-bare repo (a bare one, by definition, has no working tree).
I wouldn't recommend that method for deployment though, and I prefer:
See for instance: