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:

  1. Check whether an SSH public key is created. If so, go to the next step.
  2. Check if the project file was cloned from the remote repository (code cloud /GitHub), if not, use this method.
  3. Create a library of the same name on the remote repository (code cloud /GitHub).
  4. Copy all the files in the project (readme. md, readme.en. md,.git folders) into the clone files
  5. Right-click the file and click git bash
  6. Type git add.

  7. Git commit -m “Project Description”

  8. Input git push



    Successful upload!

Solution 2:

  1. Check whether an SSH public key is created. If so, go to the next step.

  2. Check if the project file was cloned from a remote repository (code cloud /GitHub), if so.

  3. 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**

  4. 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!!