We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在branch1开发,进行多个提交,这时切换到branch2,想把之前branch1分支提交的commit都【复制】过来,怎么办?
首先切换到branch1分支,然后查看提交历史记录,git log
例如我的git log 如下:
commit1 xxx_id1 commit2 xxx_id2 commit3 xxx_id3
我想把 commit1 和 commit3 复制到 branch2 分支里,只需要切换到 branch2 分支,然后执行
git cherry-pick xxx_id1…xxx_id3
注意中间的两个点,表示把两个commit区间的所有commit都复制过去
commit
单个 commit 只需要 git cherry-pick commitid
git cherry-pick commitid
多个commit 只需要git cherry-pick commitid1…commitid100
git cherry-pick commitid1…commitid100
注意,不包含第一个 commitid , 即 git cherry-pick (commitid1…commitid100]
git cherry-pick (commitid1…commitid100]
如果想搞成[]区间,使用 git cherry-pick A^…B 相当于[A B]包含A
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在branch1开发,进行多个提交,这时切换到branch2,想把之前branch1分支提交的commit都【复制】过来,怎么办?
首先切换到branch1分支,然后查看提交历史记录,git log
例如我的git log 如下:
我想把 commit1 和 commit3 复制到 branch2 分支里,只需要切换到 branch2 分支,然后执行
注意中间的两个点,表示把两个
commit
区间的所有commit
都复制过去单个
commit
只需要git cherry-pick commitid
多个commit 只需要
git cherry-pick commitid1…commitid100
注意,不包含第一个 commitid , 即
git cherry-pick (commitid1…commitid100]
如果想搞成[]区间,使用 git cherry-pick A^…B 相当于[A B]包含A
The text was updated successfully, but these errors were encountered: