上傳專案到GitHub時遇到的問題

2021-07-28 14:39:23 字數 1167 閱讀 1472

2.如果輸入ssh -add ~/.ssh/id_key 命令後出現報錯could not

open

a connection to your authentication agent.解決方法是key用git gui的ssh工具生成,這樣生成的時候key就直接儲存在ssh中了,不需要再ssh-add命令加入了,其它的user,token等配置都用命令列來做。

3.最好檢查一下在你複製id_rsa.pub檔案的內容時有沒有產生多餘的空格或空行,有些編輯器會幫你新增這些的。

輸入git remote add origin [email protected]:account/demo.git

提示錯誤資訊: fatal: remote origin already exists.

解決方法如下:

1.輸入 git remote rm origin

2.再輸入 git remote add origin [email protected]:account(github賬號)/demo(專案名).git

3.如果輸入git remote rm origin 還是報錯的話,

error: could not remove config section

'remote.origin'.

我們需要修改gitconfig檔案的內容,找到你的github的安裝路徑,

找到乙個名為gitconfig的檔案,開啟它把裡面的[remote "origin"]那一行刪掉就好了。

輸入git push origin master

提示錯誤資訊: error:failed to push som refs to .......

解決方法如下:

1.先輸入git pull origin master

// 先把遠端伺服器github上面的檔案拉下來

2.再輸入git push origin master

3.如果出現報錯 fatal: couldn't find remote ref

master

以及fatal: could not read from remote repository,

則需要重新輸入$ git remote add [email protected]:account(github賬號)/demo(專案名).git

上傳專案到GitHub

你一定也遇到相同的問題,每次找開源的專案,總是到github上尋找。那裡面有非常多非常多開源專案,可是某一天發現自己也成大牛了,想分享一些開源的專案,可是卻不知道怎樣上傳專案github,以下這篇文章就介紹詳細怎樣把專案上傳到github上。假設你想上傳到gitlab上。請參考這篇文章 1.申請屬於...

上傳專案到GitHub

1.沒註冊的可以先去官網進行註冊,註冊過的按以下步驟建立乙個github的倉庫。2.建倉庫首先要建立乙個github賬號,大家用郵箱即可註冊 3.新建乙個倉庫 4.配置ssh秘鑰 這個操作就是讓我們的電腦和github進行乙個繫結驗證 1.右鍵 git bash here 2.需要配置ssh 命令 ...

上傳專案到GitHub

建立倉庫 建立好了後,可以看見一些常見的操作命令 在本地配置 在本地新建乙個資料夾作為倉庫 使用命令 git clone git github.com baiyazi fdfd.git轉殖剛剛建立的倉庫內容到本地目錄 然後,進入fdfd資料夾,即 cd fdfd 在該資料夾下可以看見乙個隱藏的.gi...