Skip to content

Files

25 lines (17 loc) · 600 Bytes

diff-different-branches.md

File metadata and controls

25 lines (17 loc) · 600 Bytes

Comparing Files from 2 Different Branches

  • git diff branch master [-- <file>]
git diff feature/newsletter-widget master -- config.json
  • branches can be separated with ..
git diff feature/newsletter-widget..master -- config.json
  • in the latter case, if either branch is HEAD, it can be omitted
git diff ..master -- config.json
  • .. vs. ...
sth..master sth...master
changes between the tips of the sth and the master branches changes that occurred on the master branch since when the sth branch was started off it