gpt4 book ai didi

git - 如何将现有的 phabricator diff 一分为二?

转载 作者:行者123 更新时间:2023-12-05 03:12:00 25 4
gpt4 key购买 nike

我有一个很大的代码差异需要审查,但它确实应该分成两个单独的差异。

每个差异都有很多提交,我可以找出哪一个(大部分)将提交字符串拆分为两个不同的任务,尽管更清晰的拆分将基于文件名(即 N 个文件与 w/task-1,M 个其他文件与 task-2 相关联)。

有没有一种简单的方法可以做到这一点(通过提交或文件)?谢谢!

最佳答案

Is there a simple way to do this (either by commit or files)? Thanks!

您应该为此目的使用补丁。

[git format-patch][1]

怎么做?

# first checkout the desired commit that you want to use
# or stay on the desired branch itself
git checkout commit_id

# now create patch for the desired diff tree you want
# This command will create a **single** patch file with all the diffs
# in the given range. (X commits back)
git format-patch HEAD~X --stdout > patch_file.patch

# or if you need the full branch history use the branch name
git format-patch <branch name> --stdout > patch_file.patch

关于git - 如何将现有的 phabricator diff 一分为二?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35438497/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com