1.先貼上我參考的那些文章:
淺析Gitee怎么上傳20個以上的文件-git-PHP中文網(wǎng)
Gitee如何上傳整個項目文件夾_gitee上傳文件夾-CSDN博客(這個是最重要的)
git問題error: remote origin already exists._git error: remote origin already exists.-CSDN博客(這個是第二重要的)
解決 “fatal: Could not read from remote repository.“_git_I'm George-華為云開發(fā)者聯(lián)盟 (csdn.net)(這個也很重要)
2.當你實現(xiàn)在gitee上新建了一個倉庫:
3.然后你發(fā)現(xiàn),不知道怎么把自己已經(jīng)做好的工程文件夾上傳到gitee的時候,你可以參考這個Gitee如何上傳整個項目文件夾_gitee上傳文件夾-CSDN博客,事實上就是下載一個gitee軟件;
4.然后操作依然是借鑒上面這個鏈接博主說的,但是!會報錯,所以我總結(jié)了一下新手第一次的執(zhí)行路徑:
? ? ? ? 1.首先登錄gitee網(wǎng)頁,在個人中心設(shè)置那里配置個人公鑰,公鑰設(shè)置參考:SSH 公鑰設(shè)置 | Gitee 產(chǎn)品文檔,如果后面出現(xiàn)報錯:fatal: Could not read from remote repository,請參考解決 “fatal: Could not read from remote repository.“_git_I'm George-華為云開發(fā)者聯(lián)盟 (csdn.net)
? ? ? ? 2.選擇想要上傳的電腦上的工程的文件夾,然后右鍵,選擇git bash,如果看不到這個選項,那么就選“更多選項”,然后就能看到了,如果還看不到,那就是前面gitee的軟件沒安裝。
? ? ? ? 3.打開git bash之后,右鍵粘貼如下兩行代碼,注意,一定要替換“”里面的內(nèi)容,添加上自己的gitee賬戶的名字和綁定的郵箱,請注意這里一定要確定自己的賬戶和郵箱是正確的
git config --global user.name "your gitee name"
git config --global user.email "your gitee emaild@xxx.com"
按照如下兩張圖片確認自己的郵箱和賬戶名
按照如下方式進行粘貼和復制,gitee貌似不能直接用復制粘貼快捷鍵
????????4.設(shè)置完公鑰,email和賬戶名,就開始導入工程,嚴格按照如下的代碼順序進行執(zhí)行:
主要還是參考這個博主的文章:Gitee如何上傳整個項目文件夾_gitee上傳文件夾-CSDN博客,請務(wù)必注意 git commit -m "注釋的內(nèi)容"? 不能省略,遠程項目Http地址的取址方式有多種,我貼了其中一種。
?
git init
git add .
git commit -m "注釋的內(nèi)容"
git remote add origin 遠程項目的Https地址
git push -u origin master -f
? ? ? ? 如果你碰到了報錯:error: remote origin already exists,?請參考??????git問題error: remote origin already exists._git error: remote origin already exists.-CSDN博客
執(zhí)行以下代碼:
git remote rm origin
git remote add origin 遠程項目的Https地址
git push -u origin master -f
這個報錯其實是最容易忽視的一個錯誤,前面那篇文章的博主就忽略了這個錯誤,但事實上,當我們明明已經(jīng)把公鑰/賬戶名/郵箱號 / git init /git add . / commit-m 等操作都確認無誤后,在執(zhí)行?git push依舊會報錯,那大概率就是因為這個error: remote origin already exists的錯誤了。
? ? ? ? 我碰到的一些相關(guān)錯誤:
????????????????error: remote origin already exists.
????????????????fatal:?Could not read from remote repository.
????????????????error: src refspec master does not match any
????????????????fatal: unable to auto-detect email address
????????????????error: failed to push some refs to 'otigin'
????????????????error: failed to push some refs to 'gitee.com:xxx/xxx.git'
?????????????????Auth error: 404 not found!文章來源:http://www.zghlxwxcb.cn/news/detail-770675.html
????????????????文章來源地址http://www.zghlxwxcb.cn/news/detail-770675.html
到了這里,關(guān)于gitee新建倉庫導入文件夾的入門避坑指引:關(guān)于我碰到的那些坑的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!