[英]How to apply branch A born from branch B to branch C (without applying B to C)?
一些潜在的解决方案:
1)。 樱桃挑
git checkout master
git cherry-pick limpiezaPropiedades..listaYFormularios # Picks all commits in this range, not including the commit at 'limpiezaPropiedades'
2)。 变基
git checkout listaYFormularios
git rebase -i master
# Remove lines for commits that belong to limpiezaPropiedades
# BE CAREFUL, if you remove a commit that belongs to 'listaYFormularios', it will be lost and you will have to go through the reflog to recover it
您可以进行交互式变基,以删除不需要的F
中的提交。 通过执行以下操作来完成此操作:
F
git rebase -i master
。 F
上不在分支master
上的所有提交。 该文件是一个脚本,在完成编辑后,rebase命令将重播该文件。 在这种情况下,由于您要做的只是从F
删除一些提交,因此请删除代表您不想在F
中在P
中提交的行。 F
现在将基于master
。 请注意,您应该(可能)仅在未按F
才这样做,因为这会导致提交哈希值发生更改,并使其他开发人员在拉您的分支时感到悲伤。
有关重新定级的更多信息,Git- 重写历史记录有一个不错的概述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.