Unable to Clone/Pull Git Repository on Linux Server - linux

I am trying to clone a git repository with URL: http://user#serverIP:port/RepositoryName on a Linux server and this is the output:
Cloning into 'RepositoryName'...
fatal: unable to access 'http://user#serverIP:port/RepositoryName/': couldn't connect to host
The same error also appears when I try to pull from the repository,
while it worked properly and cloned the repository on my windows machine.
Does anyone have an idea about the problem?

Related

How can I determine the URL my git repo is located?

I am to work on a project and I have initialized a git repo on a server. Let's suppose the URL of the server is
foo.bar
and the repo is at
/var/www/vhosts/foo.bar/httpdocs
I have created a git repo by running
git init
and then I created a .gitignore file, added whatever needed to be added, committed and from my local computer, which has ssh access to the server I have attempted to clone the repo, but I do not seem to find the correct URL or something is not set for the repo. I tried something like:
git clone https://foo.bar/httpdocs/.git
The error was
fatal: repository 'https://foo.bar/httpdocs/.git' not found
I have tried with various pathes.
FYI: I have worked with git a lot in the past, but I have never set up a repository on a server, I have always received the path of repos created by someone else. Now I have created the repo, but I cannot seem to find out what the correct URL is. I have searched a lot to find this out, but unfortunately I did not find anything which would help me. Any ideas?
If you're trying to communicate via SSH, you need the SSH link, not the HTTP(S) link:
git clone <user>#foo.bar:/var/www/vhost/foo.bar/httpdocs/.git
You need git and sshd (or openssh-server) installed on the remote server, and add your SSH key to the server, under the correct user (with ssh-copy-id, of course).
This is pramar error.
The error is in line:
cit clone https://foo.bar/httpdocs/.git
you can try:
git clone https://foo.bar/httpdocs/.git
good luck.

Unable to connect to Linux git Repo from Windows machine

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 happenning and how I can get my Windows machine to sucessfully clone from a server to itself? Thanks!
A valid ssh url would be
auser#myserver-Dell-System
You can check if you can resolve and connect to that server with
ssh -T auser#myserver-Dell-System
That supposes that you have generated a public/private ssh key pair, and added your public key to ~auser/.ssh/authorized_keys file first.
See "Adding SSH Keys to authorized_keys"

Unable to git clone

I want to clone repository by using following command.
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
I have got following error with this command.
dev#ubuntu:/a/WebRtc/Tools$
dev#ubuntu:/a/WebRtc/Tools$git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
Cloning into 'depot_tools'...
fatal: 'origin' 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.
dev#ubuntu:/a/WebRtc/Tools$
I have tried this in following ways:
Update git version.
Try with Ubuntu 15.10 and 14.04.4.
Try same command in windows machine, it working.
Such an error message during a clone (not a push or pull) indicates that git is not able to properly create the local repo.
See for instance "Cannot git clone to VMWare shared folder", where the impossibility to create hard-link was problematic.
Check:
if your user has the right to create file/symlink/hardlink, or
if there is some kind apparmor policy which would prevent/limit the creation of files in your setup, or
if /a/WebRTC is a mounted folder with restricted rights

Github cloning fatal remote error

I am currently trying to clone from GitHub, and am met with an error:
git clone git://github.com/StevenHickson/PiAUISuite.git
Cloning into 'PiAUISuite'
fatal: remote error:
repository not found.
How do I go about cloning this?
You cannot use the SSH link (git:// protocol, the git#github.com thingy) for this particular repository because it isn't allowed, as we can see on the github page.
Use the HTTPS link.
git clone https://github.com/StevenHickson/PiAUISuite.git

view the git repository on remote linux server -> in Windows?

Problem: Need to view Git history visually in windows, repository is on remote Linux server (Ubuntu).
Question: What are two easy ways to view the git repository on remote linux server -> in Windows?
I have initially tried mirroring the remote mirror, then viewing it locally - updating when needed, but I get an error when connecting,
git clone --mirror username#serveraddress.com:/home/username/projectfolder
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Again I'm on Windows using Git Bash, trying to clone a remote repo that's on Linux.
Thanks in advance.
There is no importance where the repo resides.
As the error said,
1- make sure you have the address right
2- make sure you have access to the address

Resources