Home git Git can't push

Git can’t push

Author

Date

Category

When trying to push to github, I get an error:

Push failed
Failed with error: fatal: Could not read from remote repository.

Everything was fine, but here it is on a new project .. How can you solve this problem?


Answer 1, authority 100%

After the actions described in https://habrahabr.ru/post/266667/ everything worked.
I will describe what I did here:

  1. In the folder with the git folder, open the GIT GUI Here;
  2. Help- & gt; Show SSH – & gt; if everything is empty, then click generate SSH;
  3. Paste it in Github settings;
  4. Trying git push;
  5. If you are using Intellij IDEA, then in the git settings (Ctrl + Alt + S->Version Control->gt; git) select Built-in.
    When pushing, you will be prompted for the password you entered when generating SSH.

Answer 2, authority 50%

The error “Could not read from remote repository” means that git cannot read from the external repository.

There are two options:

  1. The external repository is down or unavailable for some reason (server problems, network problems, etc.)
  2. The default repository address is invalid. Can be checked with the command git remote -v .

Answer 3, authority 10%

If the git remote -v command works correctly, then you can open the GIT GUI Here for this local repository, and if there is not an empty SSH, then just press the push button and everything worked for me, although Intellij Idea issued the same error. At the same time, before that, all changes should be committed, and the git status command should show that in the local all number: nothing to commit, working tree clean.


Answer 4, authority 10%

can someone help, I solved the issue this way

if after git config -l it shows
[email protected]: login / repository
you need to change the address in this way
git config remote.origin.url https://github.com/_login_/repository

after that git push -u -f origin master
and it worked for me

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions