Recently, I learned a lot of new things in vue.js, so I encountered various problems. The following problem is the problem I encountered when UPLOADING the local project to the remote warehouse. I hope it will be helpful to you. Git push error: ssh:Could not resolve hostname gitee.com:Name or service not known fatal:Could not read from remote respository
Image:
Solution 1:
- Check whether an SSH public key is created. If so, go to the next step.
- Check if the project file was cloned from the remote repository (code cloud /GitHub), if not, use this method.
- Create a library of the same name on the remote repository (code cloud /GitHub).
- Copy all the files in the project (readme. md, readme.en. md,.git folders) into the clone files
- Right-click the file and click git bash
- Type git add.
- Git commit -m “Project Description”
- Input git push
Successful upload!
Solution 2:
-
Check whether an SSH public key is created. If so, go to the next step.
-
Check if the project file was cloned from a remote repository (code cloud /GitHub), if so.
-
Solution 1: **step1. ping github.com to obtain the IP address of github.com 192.30.252.128 step2. Add the following line to /etc/hosts: 192.30.252.128 github.com**
-
Solution 2: Run the following Python code as root
import socket host = 'github.com' try: with open('/etc/hosts', 'a+') as fp: ip = socket.gethostbyname(host) fp.write(' '.join([ip, host, '\n'])) except BaseException as e: print(e) else: print('sucess') Copy the code
Git remote -v: git remote -v:
Git remote rm alias git remote rm alias
Git remote add origin gitee git remote add origin
Git push Origin master
It worked!!