Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 吉特分行。如何将提交分配给分支?_Git_Branch_Commit - Fatal编程技术网

Git 吉特分行。如何将提交分配给分支?

Git 吉特分行。如何将提交分配给分支?,git,branch,commit,Git,Branch,Commit,我有两个分支。比如说,第一个提交的校验和是11223344,第二个提交的校验和是55667788。如何将commit 55667788分配给第一个分支?如果您只想将commit55667788中的更改应用到分支first,您只需使用cherry pick git checkout first git cherry-pick 55667788 如果在导入所有提交后,第二个second具有第一个first没有的提交(包括55667788),您将合并它 git checkout first git

我有两个分支。比如说,第一个提交的校验和是11223344,第二个提交的校验和是55667788。如何将commit 55667788分配给第一个分支?

如果您只想将commit
55667788
中的更改应用到分支
first
,您只需使用
cherry pick

git checkout first
git cherry-pick 55667788
如果在导入所有提交后,第二个
second
具有第一个
first
没有的提交(包括
55667788
),您将合并它

git checkout first
git merge --no-ff second
--no ff
参数在此处已明确说明



(From,post“”)

是否要将一个分支的提交更改应用于另一个分支?您想要什么?就把第二根树枝合并到第一根树枝上吗?@Arjan,我做到了。但我现在在git方面很差,不知道cherry pick的意思。@RedPlanet小心cherry pick的危险: