git新增遠端庫遇到的問題

2021-08-26 23:29:48 字數 701 閱讀 1970

把本地庫所有內容推送到遠端庫上指令:

$ git push -u origin master
error: src refspec master does not match any.

error: failed to push some refs to '[email protected]:accompanyling/learngit.git'

我的解決方案:

刪除當前key,然後重新生成key:

該命令行會在c:\users\administrator中生成.ssh資料夾。裡面有id_rsa和id_rsa.pub檔案。

複製id_rsa.pub檔案裡面的內容。

開啟github設定key將上面複製的內容貼上在new sshkey->key中

最後我的做法是把之前在本機上建立的版本庫全部刪掉,從新建立:

第一步,先建立空目錄:

git新增遠端庫遇到的問題

把本地庫所有內容推送到遠端庫上指令 git push u origin mastererror src refspec master does not match any.error failed to push some refs to git github.com accompanyling l...

git 新增遠端庫

在本地建立了乙個git倉庫後,又想在github建立乙個git倉庫,並且讓這兩個倉庫進行遠端同步,這樣,github上的倉庫既可以作為備份,又可以讓其他人通過該倉庫來協作,真是一舉多得。一 從這個倉庫轉殖出新的倉庫,也可以把乙個已有的本地倉庫與之關聯,然後,把本地倉庫的內容推送到github倉庫。在...

git 新增遠端庫

1 登陸github,然後,在右上角找到 create a new repo 按鈕,建立乙個新的倉庫。在repository name填入learngit,其他保持預設設定,點選 create repository 按鈕,就成功地建立了乙個新的git倉庫 目前,在github上的這個learngit...