Solution to "fatal: unable to access 'https://github.com/xxxx/xxxx.git': Failed to connect to 127..." in Ubuntu

When we use git clone projects, we often encounter "

fatal: unable to access 'https://github.com/xxxx/xxxx.git': Failed to connect to 127.0.0.1 port 8087: Connection refused

"This type of error. I have summarized three solutions to this type of error. Choosing the one that suits you is the best, and the solution that can solve the problem is the best solution.

 

the first method:

Replace " https " in "git clone https://github.com/Z3Prover/z3.git " with "git". That is "git clone git ://github.com/Z3Prover/z3.git ". This method is the simplest and most effective. If you still get an error, you can try the second method. Effective in personal testing  

 

The second method: 

You can try the two solutions from this blogger. Neither of these two methods solved my problem. You can try it. Some people say it can solve it. Reprinted from: https://blog.csdn.net/dashi_lu/article/details/89641778

 

The third method: Configure the git environment through ssh link to GitHub (password-free), personal test is effective

 

1. Install git 

sudo apt-get install git

2. Configure user information

$ git config --global user.name "Your Name"
$ git config --global user.email [email protected]

3. Initialize local warehouse settings

git init

 Connect to GitHub via ssh

1. Install ssh

sudo apt-get install ssh

ssh-keygen will confirm the storage location and file name of the key (the default is .ssh/id_rsa), and then it will ask you to enter the key password twice, just leave it blank. Therefore, generally choose the default and press Enter for everything. As shown below

2. Create a secret key file

ssh-keygen -t rsa -C "你的github账号邮箱"

 3. Add the public key to your GitHub account

      (1) id_rsa.pubCopy all the file contents;

      (2) Log in to GitHub, go to the small avatar in the upper right corner->Setting->SSH and GPG keys, and click new SSH key.

4. ssh test

ssh -T [email protected]

The result is: , indicating that the configuration is successful.

4. Use git clone https://github.com/Z3Prover/z3.git. Is the test really successful?

The following error was reported on my machine:

5. The reason is that your git buffer is too low. To resolve the above error, you need to execute:

git config --global http.postBuffer 50M

Execute git clone https://github.com/Z3Prover/z3.git again. The result is as follows:

The project can now be successfully cloned.

 

Summary: The problem is very small, but there are many solutions to the problem. I just summarized these methods together. If there are other problems, you are welcome to discuss them together, and you are also welcome to criticize and correct me. thank you all

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/csdn9874123/article/details/116461035