2

I´ll try to set up a git server on windows by following the description in this tutorial

git-server-on-windows

But trying to clone the new, empty repository I get the following exception:

error: The requested URL returned error: 403 while accessing http://myIP/NewTestRepo.git/info/refs

fatal: HTTP request failed

Are there maybe problems running the remote repository and the local repository on the same machine? Does anybody have an idea how to solve the problem?

2
  • This is an HTTP server configuration problem, not a git problem Commented Dec 21, 2011 at 11:22
  • 2
    403 means "Forbidden". You probably did something wrong with either the directory itself, or with the Allow From-directive, but without any of your configuration nobody can tell. Commented Dec 21, 2011 at 11:23

2 Answers 2

1

It could be because the http server is looking for an empty file - git-daemon-export-ok.

  1. Head to your repository, ensure it is bare, i.e when you run dir, it should look like

    drwxr-xr-x   4 fooo  admin  136 21 Dec 12:26 refs
    -rw-r--r--   1 fooo  admin  205 21 Dec 12:26 packed-refs
    drwxr-xr-x   4 fooo  admin  136 21 Dec 12:26 objects
    drwxr-xr-x   3 fooo  admin  102 21 Dec 12:26 info
    drwxr-xr-x  12 fooo  admin  408 21 Dec 12:26 hooks
    -rw-r--r--   1 fooo  admin   73 21 Dec 12:26 description
    -rw-r--r--   1 fooo  admin  161 21 Dec 12:26 config
    drwxr-xr-x   2 fooo  admin   68 21 Dec 12:26 branches
    -rw-r--r--   1 fooo  admin   23 21 Dec 12:26 HEAD
    

    If it does not, then do step 2

  2. Run git clone --bare /<Path to your repository>

  3. Create an empty file git-daemon-export-ok: echo '' > git-daemon-export-ok for Windows, just open notepad and save the empty file

Restart your server

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for your answers :D .. it was because of a wrong direcotry configuration of the httpd.conf
1

I was having this same problem and it was because I had my http.proxy setting configured for my git client so accessing the local server wasn't working. Running the following fixed it:

git config --global --unset http.proxy

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.