在使用ngnix+Git搭建http访问Git的环境的时候出现404 not find error,究其原因是因为创建Git Repository的时候忘记执行git update-server-info 命令,导致使用http或者https访问Git Resository的时候找不到文件。
解决方法如下:
(1)进入Git Repository
[root@GJZ git]# cd test.git/
(2)执行 update-server-info 命令
[root@GJZ test.git]# git update-server-info
详细点儿的解释请参阅:
http://stackoverflow.com/questions/2085402/what-does-git-update-server-info-do
Dumb server basically means accessed over HTTP. So if you access your Git repository over http:
or https:
URLs, you need the update-server-info
business, otherwise (git:
, ssh:
, etc.) you don't need it.
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)