3

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?

2
  • yep sorry about that. I'm obviously using my actual server host name, and my actual domain name.
    – user2161916
    Commented Mar 12, 2013 at 21:27
  • 1
    What are the exact permissions on that directory? Do all parents have the relevant x (execute) bit set for the user git or the group gitgroup, whichever applies? (You may want to post the permissions of these directories here — i.e., run ls -ld /srv /srv/var /srv/var/git /srv/var/git/myrepo and post the output — so we can validate them.) Last, does git push --verbose yield more info?
    – Thanatos
    Commented Mar 13, 2013 at 7:31

1 Answer 1

3

This solution helped me:

cd ~/.ssh
chmod 600 *

You must log in to answer this question.