I'm looking for a way to see my local history changes.
Kind of the equivalent way in WebStorm:
Visual Studio Code now offers this in the Timeline view. See Mark's answer.
Or alternatively, if you want a plugin to give you similar functionality, for example:
Or the more famous:
Some details may need to be configured because the Visual Studio Code search gets confused sometimes because of additional folders created by this type of plugins. To fix this, you can:
.gitignore
file.it's pretty simple, just open a file and check timeline
tab
Tip by: S P Sharan
Also if you have deleted a file, you can just create an empty file with the same name and the timeline should be populated once more!
Local history of files is now available from the Timeline view. Depending on the configured settings, every time you save an editor, a new entry is added to the list:
Each local history entry contains the full contents of the file at the time the entry was created and in certain cases can provide more semantic information (for example indicate refactorings).
From an entry you can:
compare the changes to the local file or previous entry restore the contents delete or rename the entry
see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_66.md#local-history
Local file history is being actively worked on and is in the Insiders' Build v1.66. The results will be available in the Timeline
view.
Here are the current applicable settings:
Workbench > Local History: Enabled
Controls whether the local file history is enabled. When enabled, the file contents of an editor that is saved will be stored to a backup location and can be restored or reviewed later. Changing this setting has no effect on existing file history entries.
Workbench > Local History: Max File Entries
Controls the maximum number of local file history entries per file. When the number of local file history entries exceeds this number for a file, the oldest entries will be discarded.
Workbench > Local History: Max File Size
Controls the maximum size of a file (in KB) to be considered for local history. Files that are larger will not be added to the local history unless explicitly added by via user gesture. Changing this setting has no effect on existing file history entries.
And these commands:
timeline.toggleExcludeSource:timeline.localHistory
workbench.action.localHistory.compareWithFile
workbench.action.localHistory.compareWithPrevious
workbench.action.localHistory.selectForCompare // compare any 2 entries
workbench.action.localHistory.compareWithSelected
workbench.action.localHistory.delete // delete this entry
workbench.action.localHistory.deleteAll // delete all entries of all files from local history
workbench.action.localHistory.open
workbench.action.localHistory.restore
workbench.action.localHistory.restoreViaEditor
workbench.action.localHistory.rename // rename this entry
New global commands have been added to work with local history:
workbench.action.localHistory.create
: create a new history entry for the active file with a custom name
workbench.action.localHistory.deleteAll
: delete all history entries across all files
workbench.action.localHistory.restoreViaPicker
: find a history entry to restore across all files
A bunch of new settings have been introduced to work with local history:
workbench.localHistory.enabled
: enable or disable local history (default: true)workbench.localHistory.maxFileSize
: a limit of file size to create a local history entry (default: 256kb)
workbench.localHistory.maxFileEntries
: a limit of local history entries per file (default: 50)
workbench.localHistory.exclude
: glob patterns for excluding certain files from local history
workbench.localHistory.mergeWindow
: interval in seconds during which the last entry in local file history is replaced with the entry that is being added (default 10s)
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.
If you'd like to see this feature added natively, along with all of the advanced functionality, I'd suggest upvoting the open GitHub issue here.
right-click the file and select Show History. Other day I lost my git changes because I've clicked that graphic undo option of Git. This option saved me so I could get back my code.
There isn’t any option in Visual Studio Code to see file history. If you are using Git, then you can use Visual Studio Code extension Git History to see the file changes after each commit and compare with previous commits.