Git Upload File Error: fatal: could not read from remote repository. [How to Solve]

problem

git push  – An error is reported after the U origin master is executed

fatal: Could not read from remote repository.

Solution

1. Git execution

git remote add origin [email protected]:username/xxx.git

2. Open the .ssh folder

Find the  id_rsa.pub file

3. Open GitHub’s Settings

Select SSH KEYS settings, click the New SSH key button

Open the id_rsa.pub file with Notepad, copy all the content to the Github key, and click the add ssh key button.

others:

If the error is not resolved, try resetting the SSH key

ssh-keygen -t rsa -C "github账号"

1. Open the .shh  folder, the newly generated id_rsa, id_rsa.pub two files and the new Key

2. Open the Settings of github and set the ssh key (repeat the above steps to add new SSH key )

Similar Posts: