[英]IntelliJ IDEA GitHub integration creates the repository, but gets “couldn't authorize” error trying to push
I create a new project in IntelliJ IDEA 我在IntelliJ IDEA中创建了一个新项目
Via the menu, I go to VCS -> Import into Version Control -> Share project on GitHub 通过菜单,我转到VCS - >导入到版本控制 - >在GitHub上共享项目
Enter a new repository name and click Share 输入新存储库名称,然后单击“共享”
It authenticates with GitHub ok 它使用GitHub进行身份验证
When I try to push to GitHub, a login window opens that says "Login to https://github.com/myemail@gmail.com/GitHubTest2.git " 当我尝试推送到GitHub时,会打开一个登录窗口,显示“登录到https://github.com/myemail@gmail.com/GitHubTest2.git ”
The default login is github.com/my_username. 默认登录名是github.com/my_username。 I try to login with that login and my GitHub.com password and authentication fails. 我尝试使用该登录名登录并且我的GitHub.com密码和身份验证失败。 I also try to login with my GitHub.com login (ie myemail@gmail.com) and my GitHub.com password. 我也尝试使用我的GitHub.com登录(即myemail@gmail.com)和我的GitHub.com密码登录。
After 3 tries, I get the following error message: 3次尝试后,我收到以下错误消息:
Push to GitHub failed Push authorization failure: Couldn't authorize 推送到GitHub失败推送授权失败:无法授权
Why does it authenticate with GitHub with my GitHub.com login/password but not when it tries to push the project to GitHub? 为什么它使用我的GitHub.com登录/密码与GitHub进行身份验证,但是当它试图将项目推送到GitHub时却没有?
The following worked for me: 以下对我有用:
In IntelliJ: 在IntelliJ中:
See Git push requires username and password . 请参阅Git push需要用户名和密码 。
Try to use ssh instead of https ( with the generated keypair: https://help.github.com/articles/generating-ssh-keys ). 尝试使用ssh而不是https(使用生成的密钥对: https : //help.github.com/articles/generating-ssh-keys )。
This may solve the issue for you, for me it just changed the error message I was seeing in IntelliJ from GitHub to "remote host hung up unexpectedly." 这可能会为您解决问题,对我而言,它只是将我在IntelliJ中看到的错误消息从GitHub更改为“远程主机意外挂起”。
I then tried pushing to GitHub from terminal and it worked. 然后我尝试从终端推送到GitHub,它工作正常。 From terminal, it works regardless of whether I use SSH or https. 从终端,无论我使用SSH还是https,它都可以工作。 I therefore suggest using command line git for pushing code to GitHub instead of the IntelliJ integration. 因此,我建议使用命令行git将代码推送到GitHub而不是IntelliJ集成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.