git push -u origin local-branch“错误:未找到存储库;致命:无法从存储库中读取”

时间:2017-03-05 20:34:27

标签: git github ssh

我克隆了一个存储库:

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

创建我的本地分支:

git checkout -b local-branch

做了一些改变并提交了它们:

git add .
git commit -m "small changes"

并试图将新创建的本地分支推送到公司的git repo:

git push -u origin local-branch

这是错误:

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

到目前为止我尝试过:

  • git remote set-url origin git@github.com:company / company-repo.git
  • 选中.git/config有远程url参数:

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

注意:我必须保留网址,因为 没有 将其替换为https网址。

还增加了ssh键:

ssh-add ~/.ssh/id_rsa

1 个答案:

答案 0 :(得分:0)

将新创建的存储库名称与 git remote add origin path

一起使用