git 同时推送两个不同平台的版本管理库
同时推送gitee和codeup(云效)
添加gitee账号密码推送,这个就不重复复述,百度即可
gitee可以推送后,使用codeup推送方案
由于我的codeup无法绑定我的个人邮箱,所以我采用SSH的方式推送
- 生成SSH
# 生成或复用 SSH Key(如你已有,可跳过)
ssh-keygen -t rsa -b 4096 -C "你的邮箱"# 把 ~/.ssh/id_rsa.pub 内容添加到:Codeup → 个人设置 → SSH 公钥# 把 codeup 远程改成 SSH 地址
git remote set-url codeup git@codeup.aliyun.com:xxxxx/MES2.0/sass-mes.git# 测试
ssh -T git@codeup.aliyun.com
- 添加云效远程
git remote add codeup git@codeup.aliyun.com:xxxx/MES2.0/sass-mes.git
可以通过命令查看你的远程,会出现多个指向
origin指向gitee,codeup指向云效
git remote -v
- 推送
# 推送到云效
git push codeup master# 推送到gitee
git push origin master
- 其他命令
# 移除云效
git remote remove codeup
其他命令
- 移除指定的仓库
# 移除云效
git remote remove codeup
- 打标签
就是一个稳定版的项目,类似于发包1.0.0的版本
# 本地给当前 master 分支 HEAD 打上标签:
git tag base# 推送代码和标签
git push origin master --tags
异常:
- fatal: protocol ‘gite@https’ is not supported
推送地址,本文采用的是 ssh 推送,所以选择地址应该是下面这种样式
git@codeup.aliyun.com:xxxx/xxx/xxx.git