git连接远程仓库的方式
将本地仓库推送到远程仓库
TODO: 待补充先决条件
1 将本地仓库与远程仓库关联
git remote add origin git@github.com:gaoqiang19514/react-ssr-app.git
2 修改本地分支名称
// 将本地当前所在的分支名强制修改为main
// -m 修改
// -M 强制修改
git branch -M main
3 设置本地分支main跟踪远程分支main
git branch -u origin/main main
4 推送本地内容到远程
git push
将本地仓库与远程A连接修改为与B连接
1 查看本地仓库当前连接的远程仓库(无副作用,只是为了确认当前连接的远程仓库为A)
git remote -v
2 移除本地仓库的当前远程连接
git remote remove origin
3 设置新的远程仓库地址
git remote add origin https://github.com/user/repoB.git