Reputation: 5972
These are the commands that I've ran on my server:
$ whoami
git
$ ls -l
drwxr-xr-x 3 git git 4096 Jan 16 05:48 git
$ ls -l git/
total 4
drwxrwxr-x 7 git git 4096 Jan 16 05:55 tpro.git
Then on my local machine:
$ git remote add origin git@gitserver:/opt/git/t.git
Then But when I want to push into the server from my local machine I have the following error:
$ git push -u origin master
fatal: '/opt/git/t.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Upvotes: 1
Views: 38
Reputation: 1323125
You mention tpro.git
but are trying to access t.git
.
Make sure the path exists.
And make sure tpro.git
is indeed in /opt/git
(not /home/git
)
Then try:
git remote set-url origin git@gitserver:/opt/git/tpro.git,
git push -u origin master
That will ensure master
will be pushing to origin/master
every time, with a simple git push
.
Upvotes: 1