Search code examples
gitgit-diff

Is there a way to see only a single change of git diff


Imagine for 3 files, for each I have made 2 changes. In total 6 changes.

Does git diff have any options to limit git diff to see one change at a time? And then move onto to the next change? i.e. I'd see 6 separate changes?


Solution

  • Thanks to JonSharpe's comment, the closest thing to what I asked to do is:

    git add -p
    

    With the only note that it works for unstaged changes. There is no such thing as git diff -p. And git diff <path> isn't interactive as you have to manually enter the path yourself.