Enter your email below to get insights on starting, running and growing a creative company

Compare a single file between Git branches

You've been working on a file for hours, and can't remember what change you've made. If the original version you'd like to look at is on a different branch, a simple git diff won't cut it. However, you can easily compare files across branches with:

git diff mybranch..otherbranch -- /path/to/file.ext

If you're actually on the branch and want to compare with another branch, there's a simpler way still:

git diff otherbranch.. -- /path/to/file.ext
Posted August 2017
© 2014-2018 James Chambers
Learn from my mistakes

Sign up to my mailing list to get insights about starting, running and growing a creative company.