-->

Running a Git Server on Windows Server 2012 R2/IIS

2019-05-14 20:50发布

问题:

  • Edited with Answer -

Q: We would like to run a three-tier programming git structure here at work. Programmers would be able to use Git on their local machine, clone push and fetch from a remote repository running on a "Production" virtual machine, and then finalized code on the "Production" VM is then pushed to a "Deployment" machine for use.

We're using Windows Server 2012 R2 and I am coming up with very little information on how to do this. I installed the latest Bonobo git server on the "Deployment" machine and have been testing cloning on the "Production" machine from the command line and nothing is working. It doesn't see the repository on the remote VM.

Does anyone have any information on using multiple machines on an IIS network with Git? Is Bonobo even intended for this purpose? Or is it simply a web-interface for a localhost hosted git?

A: After Will pointed me to use the browser for testing I remembered when looking at the URL that I had bound the IP address to a sub-directory within the wwwroot directory, which is why it couldn't find the .git file. I de-bound the IP address from the subdirectory and re-bound the IP address to the "Default Web Site" in IIS. After I did this it could find the Bonobo.Git.Server sub-directory and I was able to clone the repo on the "Production" Machine from the "Deployment" machine. Thanks, Will!

回答1:

I don't see any reason why Bonobo shouldn't help you with this - it basically does two things using IIS and Git:

  1. Allow you to remotely access git reposistories using an HTTP/HTTPS conversation with an IIS server
  2. Provide a web based front end (like a very, very, slimmed down version of GitHub) which lets you handle the admin of Bonobo (users, permissions etc) and also view your repository content via a web browser.

You'll have to install Bonobo on both your 'production' and your 'deployment' machines, and the two Bonobo servers won't know about each other or communicate with each other - your developers will have to set both servers as remotes and push to them appropriately, or you'll have to arrange some other automated process which does this.