James Young
James Young

Reputation: 1432

GIT central repository on Windows network share

Our company is looking at setting up a central GIT repository. As we are using Windows, we've been looking at using a network share solution, based on the following articles here and here.

However, after thinking about this I have some questions. (Warning - I'm a noob at GIT)

  1. It seems that this solution might allow developers to cause problems with the repo, by allowing them to map to the drive and play with the files (outside of the GIT client). Is there a way to prevent this? Or do I misunderstand something here?
  2. If your using network shares, does the GIT installation on the server actually have a purpose? Or is it just clients pushing back and forth from the share.
  3. Any advice on a best solution would be appreciated.

Thanks.

Upvotes: 4

Views: 7644

Answers (3)

ScottWelker
ScottWelker

Reputation: 2074

I recognize this is an old question but, I have the same question now. I've been playing with this "GIT central repository on Windows network share" setup and I can answer some of the questions and provide some tips. I'll contribute more if/when I learn it. Time will tell whether this is truly a viable solution.

  1. Re: "...might allow developers to cause problems with the repo, by allowing them to map to the drive and play with the files (outside of the GIT client)."
    • This concern is well founded. Anyone with permissions to the folder in which you place your remote repository could potentially cause problems and, developers would have such access. They'll need direction and discipline.
  2. Re: "...does the GIT installation on the server actually have a purpose?"
    • You won't install git on the server perse. Instead you'll create a "bare remote": git init --bare <YourRepoName> where the "current working directory" is your chosen network share folder. The init bare creates the repo (and subfolder) without a "working tree." I had trouble otherwise.
    • You'll also need to point developers' cloned "local" repos' "origin" to your "remote", e.g. git remote add origin file://<YourRepoFullPathName> (might have to first git remote remove origin from the "local" repos).

Upvotes: 0

Adam Dymitruk
Adam Dymitruk

Reputation: 129526

What worked best before was an install of gitolite on a linux vm. This way you have many admin options. I highly recommend gitolite.

Upvotes: 4

pilotcam
pilotcam

Reputation: 1749

You are correct in that with the windows share (although easy), you sacrifice some functionality.. permissions and server-side hooks come to mind.

Here's another question that might help: How to setup and clone a remote git repo on Windows?

Or this: Setup a Git server with msysgit on Windows

Upvotes: 3

Related Questions