When trying to push to github, I get an error:
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:
- In the folder with the git folder, open the GIT GUI Here;
- Help- & gt; Show SSH – & gt; if everything is empty, then click generate SSH;
- Paste it in Github settings;
- Trying git push;
- 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:
- The external repository is down or unavailable for some reason (server problems, network problems, etc.)
- 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
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
git push -u -f origin master
and it worked for me