Compare local files with remote Git repo using WinMerge
Here’s a clean step-by-step way to compare your local WSL repo folder vs the remote repo state in WinMerge, and then show only changed files.
1) In WSL: go to your repo and fetch remote
2) In WSL: create a “remote snapshot” folder (safe, no checkout)
This exports the remote branch into a temp folder.
-
Change
origin/mainif your remote branch is different (e.g.origin/master,origin/develop).
3) Open WinMerge and start a folder compare
-
Launch WinMerge (on Windows)
-
File → Open… (or “Open”)
-
Select Folder Compare
4) Pick the two folders (WSL paths via \\wsl$)
In WinMerge:
Left (Local working folder)
Use your actual repo path in WSL:
Right (Remote snapshot folder)
Replace
Ubuntuwith your distro name (e.g.Debian,Ubuntu-22.04).
5) Make WinMerge show only changed files
In WinMerge:
-
View → Show Different Items (wording may be “Different” / “Different Files Only”)
Now you’ll see only:
-
modified files
-
added files (exist one side)
-
deleted files (missing one side)
6) Compare files quickly
-
Double-click any file → it opens the diff view
-
Use Next Difference to move through changes
Common useful tweaks (optional)
Ignore line endings / whitespace noise
-
Edit → Options → Compare
-
enable ignoring EOL differences (CRLF vs LF)
-
optionally ignore whitespace
-
Exclude folders like .git, node_modules, dist
-
Edit → Options → Compare → Folder
-
add filters/excludes (WinMerge has “File filters”)
-
Quick “copy/paste” version (only 2 commands)
Then compare:
-
\\wsl$\Ubuntu\home\<youruser>\path\to\repo -
\\wsl$\Ubuntu\tmp\repo_remote_snapshot
Comments
Post a Comment