1. 刪除原有g(shù)it信息
進(jìn)入到項(xiàng)目的目錄,右鍵,選擇 git Bash Here
輸入 rm -rf .git
查看當(dāng)前的遠(yuǎn)程信息:git remote -v
如果有遠(yuǎn)程信息 使用 git remote rm origin
刪除
2.添加自己的遠(yuǎn)程信息
使用 git remote add origin https://xxxx.git
此步如果報(bào)錯(cuò)
fatal: not a git repository (or any of the parent directories): .git
則使用 git init
進(jìn)行初始化
之后再使用 git remote add origin https://xxxx.git
進(jìn)行添加
此時(shí)使用git remote -v
查看遠(yuǎn)程信息 可以看到剛才添加的
3.上傳代碼
注:以下的master為分支名稱,可按需修改為對應(yīng)的分支名
(1)拉倉庫內(nèi)容。如果倉庫干凈,就不用進(jìn)行這步,如果存在其他文件(如 README.md等),需要執(zhí)行rebase,命令:git pull --rebase origin master
(2)添加本地文件,使用 git add .
進(jìn)行添加
(3)進(jìn)行提交 git commit -m "init"
(4)Push代碼 git push -u origin "master"
文章來源:http://www.zghlxwxcb.cn/news/detail-696384.html
之后打開git倉庫,可以發(fā)現(xiàn)已經(jīng)上傳成功了。文章來源地址http://www.zghlxwxcb.cn/news/detail-696384.html
到了這里,關(guān)于本地開發(fā)項(xiàng)目刪除原有g(shù)it信息,上傳到自己的git倉庫的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!