problem in pushing to github

前端 未结 7 1963
星月不相逢
星月不相逢 2020-12-31 01:46

I have created a repository on github named pygame. Created a clone and added files and commited.but when I attempt to push I receive the following error:

gi         


        
7条回答
  •  忘掉有多难
    2020-12-31 01:59

    I recently experienced this problem when setting up a new clone of my github project.

    You need to include your username in the URL to your project, in the form

    https://user@github.com/project/...
    

    For example, the URL provided for my test github is this:

    https://github.com/jdblair/test.git
    

    If I add my username to it, like this, then I'm able to push and pull from github with no problem:

    https://jdblair@github.com/jdblair/test.git
    

    It is easiest to use the URL that contains the username starting from when you clone a project.

    You can change the URL for an existing project like this:

    git remote set-url origin https://user@github.com/project/foo/bar.git
    

    You can use the ssh authentication instead if you want, but that's a separate setup process.

提交回复
热议问题