2

コードの大きな diff をレビュー用に 1 つ用意しましたが、実際には 2 つの別個の diff に分割する必要があります。

各 diff には多くのコミットが関連付けられており、コミットの文字列を 2 つの異なるタスクに (ほとんど) 分割するのはどれかを突き止めることができましたが、ファイル名に基づいて分割する方がきれいです (つまり、N 個のファイルがタスクに関連付けられています)。 1、および M 個の他のファイルがタスク 2 に関連付けられています)。

これを行う簡単な方法はありますか (コミットまたはファイルによって)? ありがとう!

4

2 に答える 2

4

これを行う簡単な方法はありますか (コミットまたはファイルによって)? ありがとう!

この目的のためにパッチを使用する必要があります。

[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
于 2016-02-16T17:56:49.597 に答える