gpt4 book ai didi

git - 将更改从我的分支推送到不同远程的不同分支

转载 作者:太空狗 更新时间:2023-10-29 14:32:51 24 4
gpt4 key购买 nike

我有两个存储库,我已将第二个存储库添加为远程 (origin2)。我可以将更改从 origin1/branch1 推送到 origin2/any_branch 吗?

  1. 我更改了 origin/branch1 中的文件
  2. 提交更改
  3. git 远程更新
  4. git push origin2 origin2/any_branch 告诉我一切都是最新的。

最佳答案

使用

git push origin2 branch1:any_branch

来自 man git push:

<refspec>...
Specify what destination ref to update with what source object.
The format of a <refspec> parameter is an optional plus +, followed
by the source object <src>, followed by a colon :, followed by the
destination ref <dst>.

关于git - 将更改从我的分支推送到不同远程的不同分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22097623/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com