使用git将code同时提交多个远程仓
想用一次git提交到多个仓库,可以通过以下命令实现: # 设置第一个远程仓库 git git remote add origin https://github.com/w4ctech/hellogit.git # 新增一个远程仓库 git remote set-url –add origin https://gitee.com/w4ctech/hellogit.git # 新增另一个远程仓库 git remote set-url
想用一次git提交到多个仓库,可以通过以下命令实现:
1 |
|
此后的只需一次提交,就会将代码提交至三个仓库,如需删除某个仓库,只需执行:
1 |
|
即可。
参考文献
- 使用git将code同时提交github,gitee,coding:https://juejin.im/post/6844903569540251661
使用git将code同时提交多个远程仓
https://www.frytea.com/post/20201113194008.html