问个 git 的问题,master 的一个 commitId 出现在了一个 feature 分支上, 但是不是 merge 过来的,有什么其他的方法实现这种操作么?

233 天前
 Aruforce
这个 commit 是在 feature 分支做了很多提交后才做的;
原始操做的人也不知怎么回事...
984 次点击
所在节点    git
11 条回复
lovelylain
233 天前
cherry-pick
到处 patch 再 am 也可以
Aruforce
233 天前
@lovelylain cherry-pick commitId 会变啊
AoEiuV020JP
233 天前
好奇 git log --graph ,
Aruforce
233 天前
@AoEiuV020JP 这个 可不太行...
arnoldxiao
233 天前
@lovelylain cherry-pick commit id 会变化

merge / rebase
Aruforce
233 天前
@arnoldxiao 不是 merge ,rebase 也会改 commitId
Aruforce
233 天前
@Aruforce rebase 不会变 commitId 我傻叉了...
sapjax
233 天前
commit id 的生成 hash 算法中就包含了 parent commit 的 id.
你只移动一个 commit 过来,不移动 parent commit ,那它的 id 肯定要变化,否则就是无中生有了
Aruforce
233 天前
@sapjax
@AoEiuV020JP 感觉 rebase 的有点相似...但是看 reflog 里面没有 rebase 的操作
Aruforce
233 天前
ppokyou
233 天前
好奇答案,插眼

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/975288

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX