Cannot push to github repo

后端 未结 7 1269
生来不讨喜
生来不讨喜 2020-12-28 15:46

My repo: https://shadyabhi@github.com/shadyabhi/learnajax.git

shadyabhi@archlinux-N210 ~/github/learnajax $ cat .git/config 
[core]
    repositoryformatversi         


        
相关标签:
7条回答
  • 2020-12-28 16:00

    I have hit the same problem just now. Apparently, when you use git in command line, it wants you to enter the access token instead of password. This is really weird, but it works.

    $ git push origin HEAD
    Username for 'https://github.com':        <--- your username here
    Password for 'https://t7ko@github.com':   <--- access token here O_O
    

    PS: This is the instruction on creating token: https://help.github.com/articles/creating-an-access-token-for-command-line-use

    0 讨论(0)
  • 2020-12-28 16:04

    If your password contains special characters, git push won't work in Terminal. My workaround is open up emacs and do git push inside eshell.

    0 讨论(0)
  • 2020-12-28 16:11

    if your username or password has special characters, you can replace it with the encoded for example, if your password is "test@2010", you will write it as "test%402010" and the config command will be like this git config remote.origin.url https://{username}:test%402010@github.com/{repo_username}/{repo_name}.git

    0 讨论(0)
  • 2020-12-28 16:16

    As I understand it, github.token (and github.user) aren't used by git HTTP transport - they're only there for other tools that use GitHub's API, such as GitX and GitNub.

    I think the "Authentication failed" error must be due to you entering the wrong password. (This should be your GitHub password rather than the password to your SSH private key.)

    0 讨论(0)
  • 2020-12-28 16:17

    I was having a similar issue pushing my origin with the correct user and password. It turned out that I had turned on 2-factor Authentication and had forgotten. If you have 2-factor Authentication enabled you will need to create an application specific password to push your repo. https://help.github.com/articles/creating-an-access-token-for-command-line-use

    0 讨论(0)
  • 2020-12-28 16:18

    There is some issue (if using https) if username contains "some" special characters.

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