git指令

2020-11-06  本文已影响0人  莣忧草_3b53

转:https://www.jianshu.com/p/59516a17fcf3
Git仓库完整迁移

git clone --bare 旧的git地址
cd xxx.git
git push --mirror 新的git地址

Git创建/切换分支并关联远程仓库

git branch --set-upStream=origin/master master
git checkout -b master origin/master

Git关联远程仓库

git remote rm origin //  删除本地仓库的远程地址
git remote set-url origin 你新的远程仓库地址 // 设置本地仓库的远程地址
git remote add origin 你新的远程仓库地址 // 新增本地仓库的远程地址

git remote add upstream 稳定版本远程仓库地址;// 设置上游
git fetch upstream // 从远程的远程仓库地址更新到本地?

git push --set-upStream origin test // 在远程建立test分支

Git查看远程仓库

git remote -v
上一篇 下一篇

猜你喜欢

热点阅读