Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 3 个分支:master、featureA、featureB。我想将一些更改(不一定在单独的提交中)从分支 A 导入到分支 B,我该怎么做?我想我应该在交互模式下使用一些命令,但我还没有弄清楚该怎么做。
你会想要使用git cherry-pick.
git cherry-pick
您可以通过在命令行上指定要合并的提交哈希以声明方式执行此操作。
如果更改不一定是完整提交,git cherry-pick --no-commit则进行一些编辑,并且 a git commit(or git commit --amend) 是您所追求的。
git cherry-pick --no-commit
git commit
git commit --amend