Git 高级
Amanda Crawford-Adamo
Software and Data Engineer
将特定提交的更改应用到其他分支
【单个提交拣选】
git cherry-pick <commit-hash>
【多个提交拣选】
git cherry-pick <hash1> <hash2> ..
【用途】


切换到 main 分支
git checkout main
运行拣选命令,将 feature 分支的提交 def456 引入
git cherry-pick def456

git add <resolved-files>--continue 标志git cherry-pick --continue
要停止拣选操作,使用 --abort 标志
git cherry-pick --abort
Git 高级