Compare files across branches

published on January 21, 2020.

After some bigger rebases in git, I have to compare a file between two branches, most often master and the current branch.

git diff master my-branch -- file/to/diff

The diff will show what was added to the file in my-branch, as well what was removed. Helps a lot with fixing conflicts during rebases gone bad.

Happy hackin’!

Tags: git, diff, branches.
Categories: Development.

Thanks for reading! I would like to help you make your web application better, so let's talk.

Robert Basic

Robert Basic

Software developer making web applications better.

Let's work together!

I would like to help you make your web application better.

Robert Basic © 2008 — 2020
Get the feed