Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.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 - Fatal编程技术网

Git 如何挤压提交的选择

Git 如何挤压提交的选择,git,Git,如何将2、3和4压缩为一个提交 最后承诺 最后提交-1 最后提交-2 最后提交-3 最后提交-4 如matt所述的交互式重基,或者以这种方式,不使用交互式内容: git checkout commit2 git reset --soft commit5 git commit -m "Here's the squash" git cherry-pick commit1 完成了 交互式重基?这是否回答了您的问题?

如何将2、3和4压缩为一个提交

  • 最后承诺
  • 最后提交-1
  • 最后提交-2
  • 最后提交-3
  • 最后提交-4

  • 如matt所述的交互式重基,或者以这种方式,不使用交互式内容:

    git checkout commit2
    git reset --soft commit5
    git commit -m "Here's the squash"
    git cherry-pick commit1
    

    完成了

    交互式重基?这是否回答了您的问题?