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

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

问题描述

我想通过同一命令将我的代码在两个不同的远程存储库中推送和同步到 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 别名:

Let's me recommend this push-to-all-remotes alias:

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天全站免登陆