Skip to content

Instantly share code, notes, and snippets.

@ironpython2001
Last active May 18, 2023 08:45
Show Gist options
  • Save ironpython2001/fb15d377fef1adf88dac8988ba0ae64b to your computer and use it in GitHub Desktop.
Save ironpython2001/fb15d377fef1adf88dac8988ba0ae64b to your computer and use it in GitHub Desktop.
git diff of a file in different branches
git diff two files in different branches
D:\pathofrepo>git diff origin/branch1 origin/branch2 -- pathtofile/filename.cs
if you want to ignore white spaces
git diff -b origin/branch1 origin/branch2 -- pathtofile/filename.cs
reference:
https://stackoverflow.com/questions/4350678/git-diff-w-ignore-whitespace-only-at-start-end-of-lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment