I have a couple of local git repos I wanted to serve using apache2 so I could share the code with my laptop. I set up one project and it worked fine, but when I went to set up the 2nd repo I ran into this error:
git push origin --allEnumerating objects: 86, done.Counting objects: 100% (86/86), done.Delta compression using up to 12 threadsCompressing objects: 100% (82/82), done.error: remote unpack failed: unable to create temporary object directoryTo /var/www/git/myrepo.git ! [remote rejected] master -> master (unpacker error)error: failed to push some refs to '/var/www/git/myrepo.git'here is the bare dir and it's permissions where apache will act as the server:
ls -l /var/www/git/myrepo.gittotal 32drwxr-xr-x 2 www-data www-data 4096 Nov 4 10:04 branches-rw-r--r-- 1 www-data www-data 66 Nov 4 10:04 config-rw-r--r-- 1 www-data www-data 73 Nov 4 10:04 description-rw-r--r-- 1 www-data www-data 23 Nov 4 10:04 HEADdrwxr-xr-x 2 www-data www-data 4096 Nov 4 10:04 hooksdrwxr-xr-x 2 www-data www-data 4096 Nov 4 10:04 infodrwxr-xr-x 4 www-data www-data 4096 Nov 4 10:04 objectsdrwxr-xr-x 4 www-data www-data 4096 Nov 4 10:04 refshere is the contents of /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html # Standard error and access logs ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # Configure Git settings for HTTP access to repositories ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ # Directory permissions for the git repository root<Directory "/var/www/git"> Options ExecCGI Indexes FollowSymLinks AllowOverride None Require all granted</Directory> # Git environment settings SetEnv GIT_PROJECT_ROOT /var/www/git SetEnv GIT_HTTP_EXPORT_ALL SetEnv GIT_HTTP_ALLOW receive-pack # Git-specific error and access logs ErrorLog ${APACHE_LOG_DIR}/git_error.log CustomLog ${APACHE_LOG_DIR}/git_access.log combined</VirtualHost>and the contents of /etc/apache2/sites-available/git.conf
<VirtualHost *:8085> DocumentRoot /var/www/git # Configure Git to use the HTTP backend ScriptAlias /git/ /usr/lib/git-core/git-http-backend/<Directory "/usr/lib/git-core"> Options +ExecCGI Require all granted</Directory><Directory "/var/www/git"> Options ExecCGI Indexes FollowSymLinks AllowOverride None Require all granted</Directory> # Environment variables for Git SetEnv GIT_PROJECT_ROOT /var/www/git SetEnv GIT_HTTP_EXPORT_ALL SetEnv GIT_HTTP_ALLOW receive-pack ErrorLog ${APACHE_LOG_DIR}/git_error.log CustomLog ${APACHE_LOG_DIR}/git_access.log combined</VirtualHost>I spent several hours on this with both ChatGPT and gemini, both of which asked me to check dir permissions, owners, etc. I think everything is set up correctly. Any ideas?