简体   繁体   中英

git push -u origin local-branch “Error: Repository not found; Fatal: could not read from repository”

I cloned a repository:

git clone git@github.com:company/company-repo.git

Created my local branch:

git checkout -b local-branch

Made few changes and committed them:

git add .
git commit -m "small changes"

And tried to push the newly created local branch to company's git repo:

git push -u origin local-branch

This is the Error:

Error: repository not found
fatal: Could not read from remote repository
please make sure you have correct access rights
and the repository exists

What I have tried so far:

  • git remote set-url origin git@github.com:company/company-repo.git
  • Checked the .git/config has the remote url parameter:

    url = git@github.com:company/company-repo.git

Note: I have to keep the url as it is WITHOUT replacing it with https url.

ssh key has been also added:

ssh-add ~/.ssh/id_rsa

将新创建的存储库名称与git remote add origin路径一起使用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM