Suppose we have below two files that we want to compare inside VSCode.
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Home Page</title> </head> <body></body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Home Page</title> </head> <body></body> </html>
Open file explorer as shown in the image below.
right click on the file you want to compare → click
Select for Compare
In this step, we will select the file with which we want the comparison.
right click on the file → click
Compare with Selected
VSCode display highlights the differences between two files as we can see in the screenshot below.
Tip: If you are on OSX you can navigate to directory and type command diff index.html index-old.html