Can't clone a github repo on Linux via HTTPS

前端 未结 9 1411
别跟我提以往
别跟我提以往 2020-12-02 06:47

I\'m trying to do a simple git clone https://github.com/org/project.git on a CentOS box but get:

error: The requested URL returned error:

9条回答
  •  眼角桃花
    2020-12-02 07:28

    I was able to get a git 1.7.1 to work after quite some time.

    First, I had to do disable SSL just so I could pull:

    git config --global http.sslverify false
    

    Then I could clone

    git clone https://github.com/USERNAME/PROJECTNAME.git
    

    Then after adding and committing i was UNABLE to push back. So i did

    git remote -v
    
    origin  https://github.com/USERNAME/PROJECTNAME.git (fetch)
    origin  https://github.com/USERNAME/PROJECTNAME.git (push)
    

    to see the pull and push adresses:

    These must be modified with USERNAME@

    git remote set-url origin https://USERNAME@github.com/USERNAME/PROJECTNAME.git
    

    It will still prompt you for a password, which you could add with

    USERNAME:PASSWORD@github.....
    

    But dont do that, as you save your password in cleartext for easy theft.

    I had to do this combination since I could not get SSH to work due to firewall limitations.

提交回复
热议问题