3

Today I tried to setup a project with my friend. First, we decided to use GitLab, but later, we switched to GitHub. At the beginning, everything worked fine, I was able to push, pull and so on. But later, maybe 45-60 minutes, every push requests failed. Pull works fine.

I really don't know what to do, heres the error: IntelliJ IDEA Git Push fail

We are working together using IntelliJ IDEA 2017.1.5 and also tried switching to SSH - which did not help.

Do you guys know how to fix this error? The repository still exists and I still have access to it. I also tried re-creating the project (from GitHub) and I also tried re-installing Git.

  • I'm guessing your remote is incorrect. What happens when you try to clone the repo from github? i.e. in the terminal, navigate to a new directory and run: `git clone https://github.com/your-username/your-repo.git`? – brntsllvn Jul 08 '17 at 21:36
  • It'll create a new project but the error still exists then. –  Jul 09 '17 at 13:06

2 Answers2

1

Double-check that you are the owner of that repo, and that you don't have 2FA (two factyor authentication) activated (if you have 2FA, see "IntelliJ How to access GIT remote repositories with 2-factor authentication")

Double-check also how your GitHub account is registered in IntelliJ.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @mickedplay can you reproduce the issue when pushing (using your GitHub account) from another machine? – VonC Jul 09 '17 at 16:24
  • Yes, it's working fine on my other device. I'll try to re-install my IntelliJ-IDEA. If it's not working, I'll write back here. If it does, I'll do the same. –  Jul 10 '17 at 15:14
  • Okay, it's not working. Re-installed IntelliJ IDEA did not change anything. Using another device works fine. Any more ideas? –  Jul 10 '17 at 17:57
  • @mickedplay double-check your path (try with a simplified path, especially if you are on Windows). See also if you have a credential manager activated (as in https://stackoverflow.com/a/44600808/6309). – VonC Jul 10 '17 at 18:57
  • Doubled checked path, no credential manager and it's still 403. –  Jul 20 '17 at 21:38
1

Go to Git -> Manage Remotes in IntelliJ. If you're using https instead of ssh you should specify your url with username: https://YourUsername@github.com/your_account_name/your_repository.git

Also check your InelliJ settings Ctrl+Alt+S and search for GitHub. Then add or fix your account.

You may also want to generate an access token which can be revoked, also if using two-factor-authentication.

Then push or do some operation that needs e.g. write privileges.

User Rebo
  • 3,056
  • 25
  • 30