Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see local history changes in Visual Studio Code?

I'm looking for a way to see my local history changes.

Kind of the equivalent way in WebStorm: enter image description here

like image 399
Idan Dagan Avatar asked Sep 27 '17 11:09

Idan Dagan


People also ask

How do I view the history of a file in Visual Studio?

To retrieve a previous version of a file that exists in your Visual Studio project: Right-click the file in Solution Explorer and select View History. The Visual Studio History view will appear, showing the commits in your repo that updated the file.

How do I view changes made in Visual Studio?

Visual Studio maintains a history of file changes. Modified files are marked with a red check mark in the Solution Explorer. You can compare your changes with the original file by right-clicking on the file name and selecting Compare with Unmodified. The Diff window shows new code in green and removed code in red.


2 Answers

I think there is no out-of-the-box support for that in VS Code.

You can install a plugin to give you similar functionality. Eg.:

https://marketplace.visualstudio.com/items?itemName=micnil.vscode-checkpoints

Or the more famous:

https://marketplace.visualstudio.com/items?itemName=xyz.local-history

Some details may need to be configured because the VS Code search gets confused sometimes because of additional folders created by this type of plugins. To fix this you can:

  1. Add the history folder to your .gitignore file.
  2. Change the history folder location in the chosen plugin configuration.
  3. Configure the VS Code search to ignore the history folder.
like image 122
BBacon Avatar answered Sep 20 '22 20:09

BBacon


I built an extension called Checkpoints, an alternative to Local History. Checkpoints has support for viewing history for all files (that has checkpoints) in the tree view, not just the currently active file. There are some other minor differences aswell, but overall they are pretty similar.

like image 25
micnil Avatar answered Sep 23 '22 20:09

micnil