On my server I have a post-receive in hooks with this code
git push --mirror origin
(Origin is : git remote add origin git@gitlab.com:myproject/myproject.git)
If I execute this file on the server it works but if I on my local machine does a
git push live
I get this error:
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 286 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Votre branche est en avance sur 'origin/master' de 1 commit.
remote: (utilisez "git push" pour publier vos commits locaux)
remote: Permission denied (publickey).
remote: fatal: Could not read from remote repository.
remote:
remote: Please make sure you have the correct access rights
remote: and the repository exists.
To ssh://myserver/var/www/html/myproject/myproject.git
I understand that this is a permission problem but I don't understand which permissions that should be changed.
My keys seems to have the right permissions :
server$ chmod 700 ~/.ssh
server$ chmod 600 ~/.ssh/authorized_keys
This is the output when I execute post-receive on the server:
./hooks/post-receive
Votre branche est en avance sur 'origin/master' de 1 commit.
(utilisez "git push" pour publier vos commits locaux)
Décompte des objets: 3, fait.
Delta compression using up to 2 threads.
Compression des objets: 100% (3/3), fait.
Écriture des objets: 100% (3/3), 286 bytes | 0 bytes/s, fait.
Total 3 (delta 2), reused 0 (delta 0)
To git@gitlab.com:myproject/myproject.git
3ae70c6..6e7c1d8 master -> master)