git with IntelliJ IDEA: Could not read from remote repository

前端 未结 30 2299
夕颜
夕颜 2020-12-07 08:11

Since a few weeks, I\'m not able to pull or push from or to the remote repository. I thought it happend when upgrading to IntelliJ IDEA 14, but I can reproduce the problem w

30条回答
  •  广开言路
    2020-12-07 08:26

    I had this problem with a fork from some online course. I cloned my fork and ran into a permissions error. I couldn't understand why it was insisting I was my user from my other company. But as the previous commenter mentioned I had the Clone git repositories using ssh setting checked and I had forgotten to add an ssh key to my new account. So I did and then still couldn't push because I got THIS error. The way I solved it was to push using the Github Desktop client.

    Takeaways:

    1. When you open a new GitHub account make sure to add an ssh key to it
    2. Use different ssh keys for different accounts
    3. In general I run into some GitHub issue on IntelliJ at least once or twice for every project. Make sure you have a copy of GitHub desktop and load your projects into it. It can and will help you with lots of problems you may run into with Intellij - not just this one. It's actually a really nice GUI client and free!
    4. It probably makes sense to do what @yabin suggests and use the native client on a Mac

提交回复
热议问题