0

I want to clone the repository git@git01-ifm-min.ad.fh-bielefeld.de:pm_group/PM-Studis.git, this is not on Github, so I can't use Github for that. I thought you just had to type in git clone [remote repository name] into the Git Bash, but when I do that, I get the following message:

$ git clone git@git01-ifm-min.ad.fh-bielefeld.de:pm_group/PM-Studis.git
Cloning into 'PM-Studis'...
ssh: Could not resolve hostname git01-ifm-min.ad.fh-bielefeld.de: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

So this could have been something with the server that I was trying to get the repository from (not really, I'm fairly sure it has to be valid), so I tried again to clone a random repository from Github (with the SSH option) to see if the same happens for every repository. There I get a somewhat different message:

$ git clone git@github.com:google/agera.git
Cloning into 'agera'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

But when I clone it with the HTTPS URL instead, everything works fine.

I tried finding out what this SSH thing was about, and found this guide on Github. There I followed the "Generating a new SSH key and adding it to the ssh-agent" step (before that the .ssh folder already existed with only a known-hosts file in it). After that when I type "ssh-add -l" it shows the created key, so I think that means the key is now "in use".

But when I then type "git clone [url]" again, I still get the same error messages, both when I try to clone the Github repository and the repository I want to clone. So I have no idea what to try next. Is there something else I need to do with the key? And if the solution to this isn't something simple, perhaps someone else could grab the contents of the repository and send me a download link (assuming that it is a valid link to a repository, but it wouldn't really make sense for it to not be valid).

(I use Windows 7)

Zathnic
  • 3
  • 3
  • Could someone try to clone the repository and if it works (if the URL is valid) send me a download link? This seems like a difficult problem to solve and I only need to do this once at the moment. – Zathnic Apr 24 '16 at 20:40

1 Answers1

0

Since you mentioned that you don't have access to the remote server you have to use a different transport protocol other then git

Read about the protocols here is you are interested.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • "Once you have your key set in home/.ssh directory (or Users/.ssh under windows), open it and copy the content to the relevant section (ssh keys) under your central repository." - I don't understand how that works, where is the "relevant section" that I need to paste my key to when I just use the git bash and not Github, and I don't even have a repository yet because I want to start with a cloned repository? – Zathnic Apr 24 '16 at 19:56
  • You have to copy form your local machine to the remote server under your account – CodeWizard Apr 24 '16 at 19:58
  • I don't think I have access to the remote server... all I have is the link, and when I copy part of it, I don't get to a website. I thought you could clone a repository from a link without having to go to a website. Also, which account? The one I initialized with git config --global user.name and user.email?? – Zathnic Apr 24 '16 at 20:05
  • Then you have to use another protocol. you cant use `git://` – CodeWizard Apr 24 '16 at 20:06
  • I'm not quite sure what a protocol is, but I think I was using the SSH protocol. But I just found out this about SSH: "A minor downside is that authentication is needed for all connections, so you always need a GitHub account – even to pull or clone." --- I didn't think I'd be able to clone a repository using Github if that repository isn't from Github. I just tried adding the SSH key to my Github account, and after that I was able to clone the repository in the second yellow text box of my original question. Because that is from Github. But the repo I really want to clone isn't, can I really – Zathnic Apr 24 '16 at 20:26
  • use Github to clone that anyways? (I got the same error message when I tried to clone it in the git bash after making the change on my Github account) – Zathnic Apr 24 '16 at 20:26
  • I also tried adding "ssh://" in front of the URL when cloning, and I get the same error message again. – Zathnic Apr 24 '16 at 20:31
  • SSH & GIT need ssh keys. you cant use them unless you have keys on the server – CodeWizard Apr 24 '16 at 20:43
  • I don't understand. I created a SSH key, first added it with ssh-add ~/.ssh/id_rsa and then added it in my Github account settings. And I WAS able to clone a repository from Github, just not the other one. Which server? The computer I'm on, the Github server or the server of the URL? I'm starting to feel like there may be something wrong with the URL after all, because it can't be this complicated to simply clone a git repository. Could you check if you can clone the repository at git@git01-ifm-min.ad.fh-bielefeld.de:pm_group/PM-Studis.git, maybe? – Zathnic Apr 24 '16 at 20:58
  • Oooooookay, I think I just found out what I've been missing. I have been trying to do an assignment on a worksheet and completely overlooked that there was also an INSTRUCTION MANUAL given along with that worksheet. xDDDD I'm sorry, I gave you an impossible task trying to figure out something that actually requires inside knowledge. I think I should delete this question now since it doesn't provide any useful information for anyone, right? :P – Zathnic Apr 24 '16 at 21:30
  • No need to delete. Moderators will delete it if necessary. IT would be nice of you if you will accept and vote for this answer due to the time and help that i have been trying to give you, But im glad you found it at last. – CodeWizard Apr 24 '16 at 21:37