Git File History
View or diff against previous versions of the current file.
There are at least a couple of other extensions that provide these functionalities, but they are so bloated with features I don't need that I couldn't even make them work.
Follow the instructions in the Marketplace, or run the following in the command palette:
ext install fabiospampinato.vscode-git-history
It adds 4 commands to the command palette:
'Git: Open File at Commit' // Open the current file at particular commit in time
'Git: Open File at Commit to the Side' // Open the current file, to the side, at particular commit in time
'Git: Diff File at Commit' // View the changes made to the current file in a particular commit in time
'Git: Diff File at Commit against Current' // View the changes made to the current file between now and a particular commit in time
"gitHistory.details.author.enabled": true, // Show the name of the commit's author
"gitHistory.details.date.enabled": true, // Show the date of the commit
"gitHistory.details.date.format": "YYYY-MM-DD HH:mm", // Format used for displaying the date
"gitHistory.details.hash.enabled": false, // Show the hash of the commit
"gitHistory.details.hash.length": 7 // Show only this number of characters from the end of the hash
Dates are formatted using moment.
Open a previous version to the side
Diff against a previous version
- Diff against opened files: sometimes diffing against a previous version of a file is not enough, try Diff for diffing against any arbitrary open file you have.
If you found a problem, or have a feature request, please open an issue about it.
If you want to make a pull request you can debug the extension using Debug Launcher.
MIT © Fabio Spampinato