我知道您不能通過 cgit 推送,因為它是查看您的 git 存盤庫的前端。但它可以充當一個啞端點,例如允許克隆:
git clone http://192.168.1.124/cgit/myProject.git/,一旦你完成它,你最終會得到這個遠程源結果:
$ git remote show origin
* remote origin
Fetch URL: http://192.168.1.124/cgit/myProject.git/
Push URL: http://192.168.1.124/cgit/myProject.git/
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (fast-forwardable)
問題是當您想要推送您的更改時,您必須將 url
從:更改http://192.168.1.124/cgit/myProject.git/
為:http://192.168.1.124/git/myProject.git/。
我嘗試更改我的cgitrc的配置和apache2的配置,嘗試使用正則運算式重定向查詢但沒有結果。
你有什么配置可以解決這個問題嗎?
先感謝您。
uj5u.com熱心網友回復:
我發現這個 apache 配置對我有用。檢查查詢,然后替換 url。
ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"
Alias /cgit-css "/usr/share/cgit/"
<Directory "/usr/lib/cgit/">
RewriteEngine On
AllowOverride None
Options ExecCGI FollowSymlinks
Require all granted
RewriteCond %{QUERY_STRING} ^service=git-(receive|upload)-pack$
RedirectMatch "/cgit/(.*)/info/refs" "/git/$1/info/refs"
</Directory>
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/492660.html
