NOTE: The version of VSHistory compatible with Visual Studio 2019 can be found here.
VSHistory
VSHistory for Visual Studio saves a copy of your files every time you save them. They are stored in a special .vshistory
directory and can be opened or differences with the current file can be viewed.
A custom VSHistory tool window displays each version of project files as they're saved. Each version can either be viewed in a VS window or a difference between that version and the current file can be displayed.
Current File History
The history of the current file (the document that currently has focus) can be displayed from the menu via
View | Other Windows | Visual Studio File Histories
It is recommended that you dock the window somewhere, such as
You can see a diff of any version with the current file by clicking Diff
for that version in the VSHistory tool window. Clicking Open
will simply display that version of the file.
You can see the difference between two VS History files by checking the checkboxes of 2 history files.
VSHistory Settings
VSHistory settings allow the user to select how many versions should be maintained:
- Keep all versions
- Keep "n" versions
- Keep versions for "n" days/weeks/months
- Don't save versions more often than once every "n" seconds/minutes/hours
- Keep versions up to a maximum amount of disk space (but no less than 2 versions)
You can choose to have VSHistory files be compressed using GZIP compression when they are saved. This can save disk space if there are a lot of large files being saved in the VSHistory directories.
Location of VS History Files
By default, VS History files are maintained in subdirectories below the source files. You can optionally select an alternate location
for VS History files. This is especially useful when opening Visual Studio in Folder View.
NOTE: If the VS History files are maintained with the source files and you use a source control system like git, you may want to add the .vshistory
directory to be excluded in the .gitignore
file.
Excluding Files
All VS History Files
A display of all VS History files is available in settings:
Double-clicking a version will display a diff of that version with the current file.
Deleted Files
When a file is deleted, its file histories are kept. To view them, open All VS History Files
. The files that were deleted will have (deleted)
next to their name. Double-clicking a version will display that version.
You can add a tag to any history file by right-clicking on the timestamp in the "When Saved" column of the VSHistory toolbox.
The user-defined tags you've defined can be viewed in the "User-defined Tags" page of the VSHistory settings. You can also delete a tag on this page.
Revision History
- 3.10 Make column widths resizable
- 3.9 Mouseover of "Size" now shows the true "Size on disk" of a VSHistory version (may be zero for small files)
- 3.8 Allow non-admin installations (no longer "All Users", so each user must install)
- 3.7 Fixed handling of a rare case of a non-existent directory that is in the solution.
- 3.6 Improved support for localized date/time formats, including regional settings.
- 3.5 Incorporate fix for detecting "dirty" documents in Visual Studio 2022 17.4 and higher.
- 3.4 Make saving versions unconditional due to quirky VS2022 behavior in detecting documents as "dirty"
- Added option to enable viewing VSHistory Debug Messages
- 3.3 Minor fixes and new feature
- Added ability to only save versions once every "n" seconds/minutes/hours
- Handle a rare exception trying to find the active document.
- 3.2 Stability and performance update
- Improved performance
- Better tracking of the "current" document, especially if the VSHistory toolbox is not visible
- Minor bug fixes
- 3.1.5 Assorted fixes and improvements
- Added setting to select the file size threshold for GZIP compression
- Better support for color themes
- Localization of dates/times based on Visual Studio International Settings
- Minor cosmetic fixes
- 3.1.4 Fixed icon, added license, removed "Preview"
- 3.1.2 Cosmetic fix on Exclusions settings page
- 3.1.1 Fixed some cosmetic issues
- 3.1.0 Add features and bring into sync with VSHistory 2019.
- Support displaying difference between 2 VS History files by selecting checkboxes
- 3.0.8 Release for Visual Studio 2022 Preview
- Options to set the date format, including long, short and ISO formats
- Use standard built-in image monikers to accommodate different screen resolutions better
- "Modernized" the VSIX Project