git github cannot push to origin

前端 未结 3 1062

I may be missing something, but I\'m sure that I\'ve checked everything, I forked a repo and cloned it on my system, made some changes after commiting did git push or

3条回答
  •  粉色の甜心
    2020-12-31 14:03

    The url with

    git://github.com/my_username/my_repo.git
    

    git:// Only gives read only access as mentioned in the side too..

    enter image description here

    Whereas,

    git@github.com:my_username/my_repo.git
    

    gives read and write access as mentioned in site

    enter image description here

    Though, https://github.com/my_username/my_repo.git also has read and write access but it was not working in your case because you trying to create a new remote with the same name instead of resetting it. The correct syntax as mentioned was

    git remote set-url origin git@github.com:my_username/my_repo.git

    And

    git remote set-url origin https://github.com/my_username/my_repo.git
    

    would also work.

提交回复
热议问题