Shared Git Repository on Windows File Server (Fail)

2k views Asked by At

Before anyone jumps in and refers me to a prior post, let me say, I've gone through all of them with no success.

As the title says, I'm trying to setup a shared git repository on a Windows file server using local path (e.g. s:\SharedProjects\foo), where each developer has a local repository (e.g. c:\MyProjects\foo).

So far I've managed to create / clone the repository, but I can't push back changes from local user to shared dir. I've tried setting it as --bare repository, I've tried setting --git-dir and --work-tree, but I always different problems.

Setting the repo as bare, all of the git-dir files (.git/*) reside immediately below my root directory (s:\SharedProjects\foo\[config, HEAD, ..*]), and does not allow me to perform other repository tasks such as git ls-files or git status, saying these operations must be made in the working directory.

The I set the working directory above my bare repository (e.g. \SharedProjects\bar), and I can't perform any operations on that because it doesn't recognize a git repository :|

I'm going crazy here.. I've been trying every which way I can to set the --git-dir and --work-tree, setting my repository as --bare --share=everybody.. I lost track of where I'm at now!

Can someone please give specific step by step instructions on crating a repository (on a Windows file share) that will allow for central repository management as well as local repository push / pull operations?

Thank you all in advance!

3

There are 3 answers

0
g19fanatic On

To setup your 'Remote' Repo

  • Open a Git bash window
  • type cd s:/SharedProjects/foo
  • type git init --bare


To Setup your local repo

  • type cd c:/MyProjects/
  • type git clone s:\SharedProjects\foo foo
  • do all of your commits here locally
  • push commits to your shared repo
0
Matt Jennings On

We do this at for all our projects here. We always init with git init --bare --shared (You have --share, possibly just a typo in your post, but worth double checking)

If you still can't get it working, post the push command you are using and the results.

0
dsz On

I've been unable to get this to work in cygwin git.

I got it to work by installing the "Git for Windows" from https://git-scm.com/download/win and using that environment rather than the cygwin one.