I'm trying to setup private git server over http(s) using nginx in windows , but without any success yet.
I want it to be like github but locally and with very simple functionality . For example when you go to localhost/path/to/your/repo.git
this site will only display the source code tree list nothing else. you have to do all git commands using git console in your machine.
I saw many posts to do something like that like:
...
Actually, I need to know that do I really need nginx ? I mean can I make it work with just python server code ?
I really confused what I have to do and what I'm missing, because it's my first time to deal with something like this and don't know nginx very well.
Can anyone help me to get it done ?
NOTE I don't want to use other tools like gitlab, I want to code it from the beginning
EDIT
I read about git-http-backend in git docs. I think now I should configure nginx to work with git-http-backend.exe (because I'm in windows)
here is my nginx conf file:
location / {
root "C:/Users/One/Desktop/work";
fastcgi_param SCRIPT_FILENAME "C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe";
fastcgi_param PATH_INFO $uri;
fastcgi_param GIT_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT "C:/Users/One/Desktop/work";
include fastcgi_params;
}
I have project.git
bare repository in C:/Users/One/Desktop/work
, but git always return not found when I try to clone it.
git clone http://localhost/project.git test
Cloning into 'test'...
fatal: repository 'http://localhost/project.git/' not found
And this is nginx log file
127.0.0.1 - - [24/Jun/2015:14:04:10 +0300] "GET /project.git/info/refs?service=git-upload-pack HTTP/1.1" 404 168 "-" "git/1.9.5.msysgit.0"