0

So recently I've been trying to set up a Git server to manage personal projects and work. I created a bare Git repo on a spare laptop running Ubuntu and I installed Git Bash on my Windows machine. Right now I'm having some issues in actually being able to clone my Ubuntu git server to my Windows computer.

I used git remote add origin myserver@myserver-Dell-System:/home/myserver/CentralRepo.git but whenever I try to clone to my Windows machine, Git bash spits out this error:

ssh: Could not resolve hostname myserver@myserver-Dell-System: Name or service not known
fatal: Could not read from remote repository.

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

I double checked my add to make sure the address of my Git server was correct and I assume Git bash for Windows comes with OpenSSH.

Does anyone know why this is happening and how I can get my Windows machine to successfully clone from my server to itself? Thanks!

4
  • Does the myserver user have access to that location? – AWippler Jan 14 '17 at 15:26
  • 1
    does myserver-Dell-System resolve to the ip address of the linux server? Because that's what ssh is complaining about (could not resolve hostname ...); another option is to try ssh with the ip address instead of the dns hostname. – natxo asenjo Jan 14 '17 at 15:49
  • I should have mentioned this in case it wasn't clear, I called git remote add origin myserver@myserver-Dell-System:/home/myserver/CentralRepo.git on my server system, not on my Windows machine. The myserver user should have access to the repo since that's where I made the repo. I tried using the IP of my server instead of the hostname but then there's an issue with it refusing connections with port 22. Pretty sure there is a way around it but I'm not sure of it yet. – David47295 Jan 14 '17 at 15:55
  • Okay so a little update I managed to ssh into my Ubuntu server from my Windows machine. Turns out I had to type in ssh myserver@serverIPaddress instead of the hostname or the IP alone. – David47295 Jan 14 '17 at 16:12
0

Alright so I managed to solve my own problem after getting a few ideas into my head. Big thanks to naxto asenjo for providing me with the idea to connect via IP address.

The way I solved my issue was to simply type in ssh myserver@serverIPaddress instead of the hostname or the lone IP address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.