This error means the key you are pushing with is attached to another repository as a deploy key, and does not have access to the repository you are trying to push to. To fix this, remove the deploy key from the repository, and add the key to your personal account instead.
Open Project settings>Repositories. To set the permissions for all Git repositories, choose Security. For example, here we choose (1) Project settings, (2) Repositories, and then (3) Security. Otherwise, to set permissions for a specific repository, choose (1) the repository and then choose (2) Security.
I have set up a git repository on my server. Created a new user 'git'. My repos are located in /srv/git/example.git
. I was able to git remote add origin git@domain/srv/git/example.git
then I added and committed my changes.
However when I tried git push origin master
it failed on:
fatal: unable to create temporary file: permission denied' and 'fatal: sha1 file write error: invalid argument'
On the server I ran:
sudo chown -R git:git /srv/git/`
This fixed my problem but I am wondering if this was the correct thing to do?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With