![](/img/trans.png)
[英]Windows Git-bash fatal: Could not read from remote repository. when pushing through ssh
[英]Git Bash Fatal:Could not read from remote repository
所以我在linux機器上設置了一個git repo並輸入了
git remote add test git@*****.com:/opt/git/project.git
然后我做了
git init
git add *
git commit -m 'Blah blah'
當我去做
git push remotename
我很fatal:Could not read from remote repository.
我知道這是我自己的問題,因為我的朋友可以在他的Arch Linux計算機上使用。 我在另一個文件夾中有ssh私鑰,然后在git bash中,然后在git用戶主文件夾中都設置了公鑰。 我不知道是否需要使用git bash或其他方式設置SSH密鑰。
您需要將上游倉庫添加為遠程倉庫
git remote add remotename git@*****.com:/opt/git/project.git
現在做一個推
git push remotename
PS :您運行git add git@*****.com:/opt/git/project.git
的步驟git add git@*****.com:/opt/git/project.git
是沒有意義的,理想情況下應該向您拋出錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.