GIT INIT not creating a working tree

261 views Asked by At

I'm doing a simple git init C:\XXX running from my master machine to be executed on another slave machine. C:\XXX is a path in the slave. The assumption is that it would create a non bare repository as I did not provide a --bare option. Also I looked at the system, global config settings in the slave machine and specifically set the bare = false option in these. But even then after running the git init I can see the local config having bare = true.

From where does the init command takes the bare settings by default?

1

There are 1 answers

4
Nick Volynkin On

When you run git init <path> on your master machine, the Git app is run on master. It uses global configs of that machine, where you probably have bare=true.

To solve this you can use one of these options:

  1. Login to slave machine with SSH and run git init <path>
  2. Directly copy a premade .git to selected path on slave. This gives you an option to use tweaked repository. E.g. you can add git hooks.