O
O
Omniverse2017-05-21 05:28:19
git
Omniverse, 2017-05-21 05:28:19

How to fix permission error?

Hello.
I want to upload the project to the server. Created a user on the server:
adduser myuser Registered for
this user usermod -aG sudo myuser
Next, I went to the server under these users, created a repository:

cd /var
sudo mkdir repo && cd repo

sudo mkdir site.git && cd site.git
git init --bare

Created post-receive in hooks/
#!/bin/sh
git --work-tree=/var/www/laravel --git-dir=/var/repo/site.git checkout -f

sudo chmod +x post-receive
As a result, on the local computer I do this:
git remote add production ssh://[email protected]/var/repo/site.git

git push production master

And I get an error:
Counting objects: 242, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (225/225), done.
remote: fatal: Unable to create temporary file '/var/repo/site.git/./objects/pack/tmp_pack_XXXXXX': Permission denied
error: pack-objects died of signal 13
error: не удалось отправить некоторые ссылки в «ssh://[email protected]/var/repo/site.git»

Can you please tell me how to fix this error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TyzhSysAdmin, 2017-05-21
@Omniverse

sudo chown -R myuser:myuser /var/repo/site.git

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question