Background
I have a Linode VPS (Ubuntu 12.04 server), and I want to use Git to manage my files from the VPS to my local Windows desktop.
I have installed Git Bash and have been using that on the Windows/local end of things.
I continue to get the error:
Fatal: Could not read from remote repository
Please make sure you have the correct access rights
and the repository exists.
when I attempt to push a remote repo I've added.
Can someone double check my process, and tell me exactly what is needed for proper access rights?
Repository setup
First, I created a git
user, and put them in a group called gitgroup
. I've put in SSH keys and can login without a password to [email protected]
I would like to keep my repo in /srv/git/
, so I created a directory /srv/git/myrepo
.
Inside the directory, I ran the command git init --bare
.
On my local computer, I created a directory called git-local
, and ran git init
in it. It says it is the master repo.
So now I pull up Git Bash in my git-local
directory. I attempt to add a remote repo:
$ git remote add myrepo [email protected]:/srv/git/myrepo/
This works without error.
I created earlier an HTML file and added it to my master local repo.
I tell Git to push the changes:
$ git push myrepo master
This returns the error I've outlined above.
Permissions
The user git
is the owner and creator of /srv/var/git/myrepo
.
The group gitgroup
is the owner of /srv/var/git
(was created by root
).
What am I missing?
git
or the groupgitgroup
, whichever applies? (You may want to post the permissions of these directories here — i.e., runls -ld /srv /srv/var /srv/var/git /srv/var/git/myrepo
and post the output — so we can validate them.) Last, doesgit push --verbose
yield more info?