Remote anonymous access to repository denied?

后端 未结 5 951
借酒劲吻你
借酒劲吻你 2021-02-20 04:49

I\'m on Ubuntu 12.04 LTS and just upgraded my git from 1.7-something to version 1.8.4. The problem is when I want to push to a GitHub repo

相关标签:
5条回答
  • 2021-02-20 05:18

    I had the same problem as you. But A little different with you.

    Username for 'https://www.github.com': xxxx@gmail.com
    Password for 'https://xxxx@gmail.com@www.github.com':
    remote: Anonymous access to xxxxx.git denied.
    fatal: Authentication failed for 'https://www.github.com/yyyy/xxx
    

    And I found the cause of problem is that I clone with the prefix of www https://www.github.com/yyyy/xxx

    I solved it by git clone the repository again like this https://github.com/yyyy/xxx, and everything go right.

    0 讨论(0)
  • 2021-02-20 05:26

    The issues was not resolved however in the end I decided to go with SSH instead of HTTPS. SSH caused no problems at all (and there's no need to type in the username and pass)!

    0 讨论(0)
  • 2021-02-20 05:27

    If you want to use your SSH key, you must use the following format:

    $ <snip> on MBP-0x00A3 in ~/misc/vim_dotfiles
    ✭ (git) working on branch alternate ✔
    ❯❯ git remote -v
    origin  https://github.com/<snip>/vim_dotfiles.git (fetch)
    origin  https://github.com/<snip>/vim_dotfiles.git (push)
    
    $ <snip> on MBP-0x00A3 in ~/misc/vim_dotfiles
    ✭ (git) working on branch alternate ✔
    ❯❯ git remote add personal git@github.com:<snip>/vim_dotfiles.git
    
    $ <snip> on MBP-0x00A3 in ~/misc/vim_dotfiles
    ✭ (git) working on branch alternate ✔
    ❯❯ git remote -v
    origin  https://github.com/<snip>/vim_dotfiles.git (fetch)
    origin  https://github.com/<snip>/vim_dotfiles.git (push)
    personal    git@github.com:<snip>/vim_dotfiles.git (fetch)
    personal    git@github.com:<snip>/vim_dotfiles.git (push)
    

    Now you can do:

    user@host:~$ git push personal <branch>
    

    and it will force use of your SSH key.

    0 讨论(0)
  • 2021-02-20 05:39

    I faced a similar problem and got to this question in the search for an answer.

    Figured out the issue.

    1. Using the command git push without adding any files can give this error
    2. Using the command git push without adding any commits can do the same

    so the simple solution would be to follow this

    git add --all .
    git commit
    git push
    
    0 讨论(0)
  • 2021-02-20 05:40

    I had this issue due to the fact that I had 2-Factor-Auth enabled, and the password it was asking for was the generated password / personal access token, not my LDAP password. I didn't remember that I had set it up at the time.

    Creating a Personal Access Token: https://help.github.com/articles/creating-an-access-token-for-command-line-use/ , allowed me to push successfully using the generated token as a password.

    Context: Internally hosted Enterprise Github. Able to clone, enabled as a collaborator, but unable to push origin master.

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