Why is Git trying to connect to the wrong host?

I have LAMP installed on CentOS. I also have git setup on the same server with a centralized workflow (we just switched from SVN). I have several repositories that are now cloned around the system using the following syntax:

git clone git:someexistingrepository.git

It works great. Now I had an existing directory in which I wanted to convert to a git working directory. I followed the instructions from the accepted answer to this question . Since I am using a local server, I used the following command:

git remote add origin git:myrepo.git

myrepo.git already been configured with:

git init --bare myrepo.git

I did this before and I had no problems, however this time I did it when I ran:

git push -u origin master
The authenticity of host 'git (173.192.58.115)' can't be established.
RSA key fingerprint is b1:43:2f:b0:7e:2f:ba:74:6f:19:2e:b8:35:81:10:b6.
Are you sure you want to continue connecting (yes/no)? ^C

IP- , -, git.co.uk - , ( Git). - , - , ? , git:reponame.git ( , SO, ) - ?

. SSH, git. , config .git :

[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = git:somerepo.git

, , , , , , . git:// () :

git clone git://bugs.git
Initialized empty Git repository in /tmp/bugs/.git/
fatal: Unable to look up  (port 9418) (Name or service not known)

2

Oskar N, , root , , , , , - /etc/skel...

[user@host ~]$ cat .ssh/config
Host git
        Hostname localhost
        User git
        IdentityFile ~/.ssh/id_rsa

, git ( , !). resolveip, , - /var/www/, root. , .

+4
1

- URL-. "git:" , "git", git.co.uk. , SO, , git://, git.

SSH ssh://user@hostname/path/to/reponame.git , user@hostname:path/to/reponame.git . , reponame.git URL-.

+3

Source: https://habr.com/ru/post/1538401/


All Articles