步驟一 : 碼云新建倉庫
步驟二 : 打開本地項(xiàng)目文件夾
步驟三 : 步驟二中文件夾空白處右鍵,選中Git Bash Here
步驟四 : 初始化新本地倉庫:git init
步驟五 : 將你本地倉庫與碼云上的遠(yuǎn)程倉庫關(guān)聯(lián)起來
git remote add origin 遠(yuǎn)程倉庫地址
步驟六 : 設(shè)置項(xiàng)目級別簽名,即代碼上傳用戶描述
cat .git/config
git config user.name jmq 設(shè)置項(xiàng)目提交用戶名
git config user.email dsasdada@163.com 設(shè)置項(xiàng)目提交郵箱
cat .git/config 查看是否成功
步驟七 : 繼續(xù)執(zhí)行 git pull origin master 命令,將碼云上的倉庫pull到本地文件夾
步驟八 : 添加提交代碼:git add .
步驟九 : 添加本次提交說明:git commit -m “first”
步驟十 : 將本地代碼上傳到碼云倉庫:git push origin master
步驟十一 : 回到碼云刷新倉庫,顯示查看上傳成功
-
問題描述:
??在git中利用pull拉取遠(yuǎn)程倉庫文件時(shí)報(bào)錯(cuò):
error: The following untracked working tree files would be overwritten by merge: -
分析原因:
??untracked working tree files -
解決方式:
??百度大多數(shù)解決方式是刪除 一些 沒有 git add 的 文件,但是測試后卻并未解決問題。
$ git clean -d -fx
$ git pull origin master文章來源:http://www.zghlxwxcb.cn/news/detail-636052.html
最終解決方式:
$ git fetch origin
$ git clean -f
$ git reset --hard origin/master文章來源地址http://www.zghlxwxcb.cn/news/detail-636052.html
到了這里,關(guān)于git上傳本地項(xiàng)目的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!