Although i have read many posts, I was not able to solve this problem.
I want to use Git + Smart Http, using a remote repository on my rasperry pi.
I'm running on Arch Linux.
First, let's consider an Http configuration (and not https), for semplicity.
Apache and Git are correctly installed on my Rasperry Pi, and the port for the Http connection is 8080.
On my Raspberry Pi:
1. I have uncommented in /etc/httpd/conf/http.conf the lines about mod_cgi, mod_alias, and mod_env
2. I have added to /etc/httpd/conf/http.conf these lines:
SetEnv GIT_PROJECT_ROOT /srv/git
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
Require all granted
# mkdir -p /srv/git
# mkdir -p /srv/git/test.git
# git init --bare
# chown -R http:http /srv/git/test.git
$ git clone http://address:8080/git/test.git
$ nano test.c
$ git add test.c
$ git commit -m 'first'
$ git push origin master
atal: unable to access 'address:8080/git/test.git/';: The requested URL returned error: 403
If you clone the repo inside the test folder (in which you initialized a git repo), that means you have:
If you are pushing from the first test folder, that repo would not have any origin.
Try in instead to remove any test folder, and start over with:
git clone http://address:8080/git/test.git cd test # work git add . git commit -m "work" git push -u origin master
Regarding the 403 error, I would recommand on the server Apache (2.4) side:
<Directory "/usr/lib/git-core*"> Options ExecCGI Indexes Order allow,deny Allow from all Require all granted </Directory>
<LocationMatch "^/.*/git-receive-pack$"> Options +ExecCGI Require all granted </LocationMatch> <LocationMatch "^/.*/git-upload-pack$"> Options +ExecCGI Require all granted </LocationMatch>
Also, on the server, in the git bare repo folder:
cd /srv/git/test.git git config --file config http.receivepack true