2

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.

Hugo y
  • 1,421
  • 10
  • 20
  • 1
    Given that the path has backslashes instead of forward slashes, it sure looks like someone forgot to quote something and passed a string through a shell that ate the backslashes. Windows systems accept forward slashes so you could try that. – torek Sep 19 '19 at 07:02

1 Answers1

0

After more fiddling I determined the problem is with Git Gui because I can get it to work in Git Bash with either of the two following path formats:

git clone C:/Users/SomeUser/Documents/GIT/REPOS/BARE
git clone /c/Users/SomeUser/Documents/GIT/REPOS/BARE

But even in Git Bash this format causes problems.

git clone C:\Users\SomeUser\Documents\GIT\REPOS\BARE