2

I have two public repositories: origin and peterI:

C:\Users\[path]\app>git remote -v
origin  ssh://[email protected]/~manuelM/public_html/public.git (fetch)
origin  ssh://[email protected]/~manuelM/public_html/public.git (push)
peterI  ssh://[email protected]/~peterI/public_html/public.git (fetch)
peterI  ssh://[email protected]/~peterI/public_html/public.git (push)

When I try to fetch the latest code from the public repository peterI, I get this error:

C:\Users\[path]\app>git fetch 
[email protected]'s password: [My password] 
fatal: '~peterI/public_html/public.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.

The repository definitely exists: ssh://[email protected]/~peterI/public_html/public.git. What access rights do I need to configure? Maybe something about permissions? Thanks.

UPDATE 1. I tried what Trevor Tracy suggested in his answer and no success:

C:\Users\[path]\app>git remote -v
origin  ssh://[email protected]/~manuelM/public_html/public.git (fetch)
origin  ssh://[email protected]/~manuelM/public_html/public.git (push)
peterI  ssh://[email protected]/~peterI/public_html/public.git (fetch)
peterI  ssh://[email protected]/~peterI/public_html/public.git (push)

C:\Users\[path]\app>git remote remove peterI

C:\Users\[path]\app>git remote -v
origin  ssh://[email protected]/~manuelM/public_html/public.git (fetch)
origin  ssh://[email protected]/~manuelM/public_html/public.git (push)

C:\Users\[path]\app>git remote add peterI ssh://[email protected]/~peterI/public_html/public.git

C:\Users\[path]\app>git remote -v
origin  ssh://[email protected]/~manuelM/public_html/public.git (fetch)
origin  ssh://[email protected]/~manuelM/public_html/public.git (push)
peterI  ssh://[email protected]/~peterI/public_html/public.git (fetch)
peterI  ssh://[email protected]/~peterI/public_html/public.git (push)

C:\Users\[path]\app>git fetch peterI
[email protected]'s password: [My password]
fatal: '~peterI/public_html/public.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.


C:\Users\[path]\app>

UPDATE 2. I went to see the file .git\config and this is what I see at the end of that file:

[remote "peterI"]
url = ssh://[email protected]/~peterI/public_html/public.git
fetch = +refs/heads/*:refs/remotes/peterI/*

The public repository ssh://[email protected]/~peterI/public_html/public.git seems to be there. What could I be doing incorrectly? Maybe I need specific permissions for ssh://[email protected]/~peterI/public_html/public.git?

UPDATE 3: I am starting to suspect that this is a problem about files and folder permissions in Linux.

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103

2 Answers2

1

It was a permissions problem. I had to create a group and add users to it. Then change the group ownership of the Git folders to this group that I created, and the problem was fixed.

I had migrated from one server to another one, and for some reason the group was not the same for the Git folders during the migration process. Everything is working correctly now, the problem was about permissions.

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103
0

Try git fetch peterI

You could also remove the old remote:

$git remote remove peterI

And add the missing remote:

$git remote add peterI ssh://[email protected]/~peterI/public_html/public.git

$git fetch peterI master
Trevor Tracy
  • 356
  • 1
  • 10