git 修改远程仓库源
生活随笔
收集整理的這篇文章主要介紹了
git 修改远程仓库源
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
自己已經寫好了一個項目,想上傳到 github
github 創建新項目
新建 README.md , LICENSE
本地項目添加 github 遠程倉庫源
- 不是git項目
git remote add origin https://USERNAME:PASSWORD@github.com/USERNAME/pro.git 已是git項目,先刪除再添加
```
git remote rm origin
git remote add origin https://USERNAME:PASSWORD@github.com/USERNAME/pro.git```
沖突
Git refusing to merge unrelated histories
需要加上 --allow-unrelated-histories.因為新版本默認關閉了這個選項
關于git的 merge 操作我一直比較懵,所以我用git rm ,等成功 git push 后 再chekcout:
git rm README.md git push git checkout -- README.md
從已有的git項目導入到 github
導入個人git項目到 github 的正確姿勢
code import
git[ssh]://git:pass@example.com/var/git/pro.git
添加 branch 的方式導入到github
git remote add branch https://USERNAME:PASSWORD@github.com/USERNAME/pro.git git pull branch轉載于:https://www.cnblogs.com/dapianzi/p/8110136.html
總結
以上是生活随笔為你收集整理的git 修改远程仓库源的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python os.chdir() 方法
- 下一篇: composer 更改为中国镜像