Unable to push to github with EGIT

泪湿孤枕 提交于 2019-12-23 01:19:19

问题


I have been trying to configure Eclipse (Oxygen) to be able to push to a repository on github, but to no avail. I have been trying many different configurations and using the command line, TortiseGit and Atlassian Sourcetree. I have had varying levels of success with all the others, but not with EGIT on Eclipse. I can clone the repo and import it. I can pull changes from it. But when go to push I always get the same problem, a "Not authorized" error. I have tried using _netrc, ssh keys, and passwords, all to no avail. I have tried following the instruction on all of the other questions of a similar nature I could find on stackoverflow, also with no joy. I don't know what else to try.


回答1:


I got it working. I am not sure what solved the problem. What I did was removed every other program that was git related. (guthub, git for windows, sourcetree, TortiseGit), removed all of the left over directories from them. Deleted all my existing keys related to git and created new ones. Then I followed the EGIT docs, which was challenging in a couple of places since they don't exactly match GitHub's web pages anymore. But in the end the process worked as advertised and I was able to pull and push.




回答2:


Follow the EGit push upstream section, using https, and entering your GitHub username and password, using an https (not ssh) URL:

https://github.com/<yourUsernameOnGitHub>/<yourRepo>

Make sure 2FA is not activated (or you would need a personal token) and that your password does not include any special characters.

Make sure you are pushing to a repo that you own.

Double-check if you have a git credential helper:

git config credential.helper.

If you see manager, open your Windows Credential Manager:

See if you had an entry in there with older credentials:

You could delete them and try again.



来源:https://stackoverflow.com/questions/48272505/unable-to-push-to-github-with-egit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!