problem in pushing to github

前端 未结 7 1796
星月不相逢
星月不相逢 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:51

    It's all in the remote.

    Change your current remote from https://github.com/amalapk/pygame.git to git@github.com:amalapk/pygame.git and enjoy.

    To do this... (assuming your current remote is called origin)

    git remote set-url origin git@github.com:amalapk/pygame.git
    
    0 讨论(0)
  • 2020-12-31 01:54

    Committing to github from server this is what worked for me in the terminal or git bash

    To create a remote to github.com try:

    git remote add origin https://put your username here@github.com/put your git username here/put your repository name here
    

    To change the remote just do:

    git remote set-url origin https://put your username here@github.com/put your git username here/the name of your repository here
    
    0 讨论(0)
  • 2020-12-31 01:56

    Please follow the instructions on http://help.github.com/create-a-repo/

    You have cloned your repository with the public read only url.

    RTFM

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-31 02:08

    The GitHub Remote page mentions the read/write addresses for a repo:

    Make sure your clone address is like:

    https://github.com/username/yourRepo.git
    

    And that you have defined:

    git config --global user.name "Firstname Lastname"
    git config --global user.email "your_email@youremail.com"
    

    Should you use a git address (without ssh), you would also need:

    git config --global github.user username
    git config --global github.token 0123456789yourf0123456789token # no longer needed
    

    (with your token coming from “Account Settings” > Click “Account Admin.”)

    Update 2013: you still can generate a token (see "Creating an access token for command-line use"), but you would use it as a password for https url.

    Actually, if you activate the 2FA (two-factor authentication) mechanism on GitHub, you will need a token for your https url (because your regular password would trigger the second-step verification).
    See "Configure Git clients, like GitHub for Windows, to not ask for authentication"

    See more at "Which remote URL should I use?".

    0 讨论(0)
  • 2020-12-31 02:08

    In my case getting rid of such error message was resolved this way: Person was simply added to github repository as a colaborator. Thats it - error vanished magically.

    0 讨论(0)
提交回复
热议问题