我可以在同一命令行中放入两个远程存储库吗? [英] Can i push into two remote repository in the same command line?

查看:45
本文介绍了我可以在同一命令行中放入两个远程存储库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用同一命令将我的代码在两个不同的远程存储库中推送并同步到Gitlab和Github,这可能吗?

I want to push and syncronize my code in two different remote repository, to Gitlab and Github at the same command, is it possible?

推荐答案

让我推荐以下 push-to-all-remotes 别名:

git config [--global] alias.push-to-all-remotes '!git remote | xargs -I% -n1 git push %'

用法: git push-to-all-remotes master .

摘自 gitalias.com (完整披露:我是那里的贡献者.)

Taken from gitalias.com (full disclosure: I'm a contributor there).

这篇关于我可以在同一命令行中放入两个远程存储库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆