How Do I Use Beyond Compare: Introduction to Beyon
  • Forty things about Beyond Compare
  • Acknowledgements
  • Learn Beyond Compare in 5 Minutes
    • Quickstart: open two directories
    • Quickstart: open two files
    • Quickstart: move a file
    • Text Compare: understand the display
    • Downloads
  • Text Compare
    • How to use Beyond Compare for Text Compare
    • In Beyond Compare, what are unimportant differences?
    • Why no word-wrap ??
    • How to use Beyond Compare to confirm 100% replacement
    • Ignore Trivial Differences, Like Timestamps
  • Git
    • How to use Beyond Compare with Git
    • Do a roll-back to peek at your old code
    • Quickstart: Folder Merge
    • Why merge three folders?
    • Beyond Compare Three-Way Folder Merge Symbols Explained
    • How to compare two commits, both old, in Git
    • Git mergetool: merging three files.
    • How to recover an older version of your code with Git and Beyond Compare
    • Peeking under the hood at how Git does its thing
    • Getting better at Git
    • Find changes since last commit
    • Patches
    • How to configure Visual Studio to use Beyond Compare for Version Control
  • Scripts and the Command Line
    • How to use Beyond Compare in the Terminal
    • How to do an automatic backup every day
    • Write a Batch File That Will Start Several Syncs Simultaneously
    • Write a batch file that will start several text compares automatically
    • TL; DR
  • Table Compare
    • Quickstart: open a couple of Excel spreadsheets
    • Example: finding missing items in a pair of spreadsheets
    • Keys
    • Mismatched Columns
    • Longer example, opening .csv files
    • How to remove columns from a spreadsheet
    • Aligned vs Unaligned
    • Example: List of City Trees
  • Sync / Folders
    • Backup your entire computer (Part One)
    • Backup your entire computer (Part Two)
    • Backup, advanced
    • RegEx Examples: Filename Alignment Overide
    • Scan a lot or a little
  • Other
    • Peek
    • Binary
    • Undo
    • Colors
    • How to compare images
    • Report: Text Compare
    • Report: Table Compare
    • Looooonnnnngggg lines...
    • Binary: How to see the 1's and 0's
    • How to write your first script
    • How to find redundant or duplicate files
    • Minor Edge Cases
    • Shortcut Key
    • How to ignore parts of your file
    • Folder System Context Menus
    • About Evan Genest
Powered by GitBook
On this page
  • Why
  • Try it
  • Review
  • Productivity hack

Was this helpful?

  1. Git

Find changes since last commit

PreviousGetting better at GitNextPatches

Last updated 6 years ago

Was this helpful?

Why

After you write a bunch of code and save it, you sometimes can't perfectly remember the details of all the things you changed. The syntax for comparing what you saved to what you committed in Git is git difftool <filename>.

Try it

First, make sure you as Git's tool.

Skip Steps 1, 2, & 3 if you are using your own code.

  1. Make a new folder, start a repository there, and open an editor mkdir te && cd te && git init && nano streets.txt

  2. Save the file in your editor. Then commit that. git commit -m "First commit."

  3. Now that you have a file and are in a repository, go into your editor and add some lines. Save the file but don't commit it.

  4. Briefly glance at the terminal way to see your saved code vs. your committed code: git diff streets.txt

  5. Now see the same thing in Beyond Compare! Way better:git difftool streets.txt

  6. Finish by writing your commit message: git -m "Capitalize all. Specify South and Hills. Add four streets."

Review

What we just diffed was the Working Tree vs the Commited Repository

Productivity hack

Another way to use difftool is to always start the day with it.

The Changelog's says his favorite trick is to end the day by saving files to his index but not committing them. That way in the morning he is forced to read his diff, and then write his commit. This morning ritual reintroduces him to what he was thinking at yesterday's quitting time.

Adam Stacoviak
set Beyond Compare
Image by Freek Dijkstra