DEV Community

Kenneth Lum
Kenneth Lum

Posted on

2

To diff two files side by side, without opendiff, Microsoft Visual Studio Code, Perforce diff works too

opendiff can be large, because XCode is required to run, depending on your platform, and it can take a good 35GB or more. But if you already have Microsoft Visual Studio Code, we can first add it to the command prompt by bringing out the command palette, type in shell, and choose

Install 'code' command in PATH

and then in Bash or Zsh, it can be

code --diff file1.js file2.js
Enter fullscreen mode Exit fullscreen mode

or just use -d

code -d <path1> <path2>
Enter fullscreen mode Exit fullscreen mode

Perforce diff can be used as well, and it'd be smaller size than opendiff

Top comments (1)

Collapse
 
verious profile image
Verious

Visual Studio
use the Developer Command Prompt, so the proper paths and environment variables are loaded

devenv /Diff <path1> <path2>
Enter fullscreen mode Exit fullscreen mode

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay