Is --bare equal to core.bare configuration in Git?

I want to create a git repository on my server to update my site after clicking. The first step of all the tutorials (for example: http://developertheory.com/how-to-auto-deploy-apps-after-git-push/ ) I found this command:

git init --bare

In the next steps I should enter the following commands:

git config core.worktree /path/to/git/deploy
git config core.bare false
git config receive.denycurrentbranch ignore

the second command ( git config core.bare false) sets the repo to non-bare. Why do we start the repo like naked and then set it non-naked ?!

+1
source share
1 answer

I suspect this tutorial uses git init --bareas a “clean” way to create an empty repo that cannot be mixed with actual files:

.git, , .
git checkout ( ) - , - ( , , ).

, :

  • ,
  • post-receive () , , .

. :

+1

All Articles