I am trying to determine the best practice for creating a bare repo on a local shared drive and pushing to that repo from local users. This is surprisingly not well documented or I have a bug.
The OS is Win10 and I've installed git2.23.0-64
. The simplest and most reliable way I have found is to create a repo, add some file, and commit. Then convert it to a bare repo and clone it. This works smoothly every time. When I try to start with a a bare repo I run into problems.
You get the warning that you have cloned a bare repo which I have read I am to ignore. I can add a file to the remote and commit but when I try to push it back to the bare repo the path is incorrect. For some reason it is stripping out the path separators and I get the following message:
fatal: 'C:UsersLocalUserDocumentsGITBARE' does not appear to be a git repository.
fatal: Could not read from remote repository
When I specify an arbitrary path it works.C:\Users\LocalUser\Documents\GIT\BARE
Is this a known windows bug or did I do something wrong? Originally I thought this was a Git Gui problem but it happens in the command line as well. In the config file I noticed the URL is missing the path separators so I added / and that seems to have fixed it. I've spent way to much time on this so any advice is appreciated.