To enable this scenario, edit the config file in C:RepositoriesTest.git on the server and add the following lines to the bottom of the file: Sometimes you may want to allow users to push to your repositories without authentication, for example when using an internal, privately hosted server. This is because by default, you can only pull from repositories anonymously, while pushing requires authentication to be enabled. If you try to push changes to the repository you cloned in step 5, you’ll receive an error: Next, clone the test repository that you crated in step 3 by issuing the command git clone If all goes well, you should see the following output:Īt this point, you can now clone repositories from the server without any authentication. The final lines tell apache to route git-specific URLs to the git http server.įinally, if you want to be able to clone from the server without authentication, then you’ll need to tell Apache to allow anonymous access by adding the following lines into nf: Īfter saving the changes, restart the Apache service. The second line tells git that all repositories in this directory should be published over http (by default, git will only publish those repositories that contain a file named “git-daemon-export-ok”). The first line tells git where your repositories are located. "C:/Program Files (x86)/git/libexec/git-core/git-http-backend.exe/$1" This is done by editing nf in C:Program Files (x86)Apache Software FoundationApache2.2confĪt the bottom of nf, add the following lines: SetEnv GIT_PROJECT_ROOT C:/Repositories Next, you’ll need to modify the Apache configuration file so that it forwards requests to git-http-backend.exe. You’ll also need to put some content in this test repositor For testing purposes I created an empty test repository: Step 3: Create Repositories DirectoryĬreate the directory where you want to store your git repositores. If you visit at this point you should be greeted with Apache’s standard “It works!” message. I ran through the installation using the default options so my Apache instance is running on port 80. I’m using the 2.2.16 installer which can be found here. Next you’ll need to install the Apache webserver. Now when you run git-http-backend.exe from a command prompt, the application should run and you should see an HTTP 500 server error: In order to fix this, copy libiconv2.dll from C:Program Files (x86)Gitbin to C:Program Files (x86)Gitlibexecgit-core If you try and run git-http-backend.exe you’ll get the message that the application couldn’t be started because libiconv2.dll is missing: By default, the git http server is located at C :Program Files (x86)Gitlibexecgit-coregit-http-backend.exe (on 圆4 systems). Once installed, you’ll need to tweak the installation slightly. Be sure to select Run git from the Windows Command prompt when the installer asks you if you want to modify your PATH variable. The current stable version is 1.7.0.2, but this process should also work with the 1.7.1 beta. Step 1: Install Gitįirstly you’ll need to install msysgit. While this is certainly one way to host a git server on windows, I wouldn’t recommend this in a production environment.Īn alternative (and somewhat more stable) approach is to use the native implementation of git-http-backend that ships with msysgit along with Apache. Last month I posted about hosting a git server under IIS by using GitAspx.
0 Comments
Leave a Reply. |