前言
一直都是将MyClouds提交到gitee,今天想同时推送一份代码到github去作为备份。尝试了一下还是很方便的。
步骤
1. 打开工程根目录下的.git\config配置文件。追加github相关配置。
[remote "gitee"]
url = https://gitee.com/osworks/MyClouds.git
fetch = +refs/heads/*:refs/remotes/gitee/*
[remote "github"]
url = https://github.com/xiongchun/myclouds.git
fetch = +refs/heads/*:refs/remotes/github/*
2. 执行git remote命令查看一下。正常的话应该显示:gitee和github两个远程仓库列表。
3. 执行git push github或者git push gitee就能分别推送到不同的仓库,也可以同时批量推送。
后记:MyClouds开源开发平台 https://gitee.com/osworks/MyClouds