如何将git提交的子序列作为单独的分支断开+;合并提交

如何将git提交的子序列作为单独的分支断开+;合并提交,git,Git,哪些非交互式git命令实现了从之前到之后的更改(其中BC是合并提交) 之前: A---B---C---D 之后: B---C / \ A-------BC---D' 下面是我要做的: $ git branch to-merge-in C-commit-ID # Create a branch at C $ git reset --hard A-commit-ID # Reset current branch to A $ git merge --no-f

哪些非交互式git命令实现了从之前到之后的更改(其中BC是合并提交)

之前:

A---B---C---D
之后:

  B---C
 /     \
A-------BC---D'
下面是我要做的:

$ git branch to-merge-in C-commit-ID    # Create a branch at C
$ git reset --hard A-commit-ID          # Reset current branch to A
$ git merge --no-ff to-merge-in         # Merge in branch. Create a merge commit.
$ git cherry-pick D-commit-ID           # Grab the commit D