How do you compare file of current branch with file in given commit in VsCode?

Issue

I’m working on a project on a given branch in VSCode, and want to compare my current file with the contents of the same file in a previous commit on a different branch. I think I can do this with the diff command, but I want to do it visually in VSCode. Does anyone know how to do this?

Solution

You can use GitLens or Git History

In GitLens, you can run the editor command "Open changes with Branch or or Tag…". You can open the editor commands by pressing Control / Cmd + Shift + P.

Answered By – Ali Heikal

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published