Get "PHP 8 in a Nuthshell" (Soon includes PHP 8.4)
Amit Merchant

Amit Merchant

A blog on PHP, JavaScript, and more

VS Code Timeline — Your local version control system

If you’re a developer, you must be familiar with the concept of version control. It’s a system that records changes to a file or set of files over time so that you can recall specific versions later.

The most popular version control system is Git. It’s a distributed version control system that allows you to keep track of your source code history. It’s also a powerful tool that lets you collaborate with your team members.

But what if you could have a version control system for your local files? A system that lets you keep track of the changes every time you save a file. And a system that lets you go back to a previous version of a file if you want to. All of this without having to set up a Git repository?

That’s where VS Code’s “Timeline” feature comes into play that I’ve never paid attention to until now.

The Timeline tab

Essentially, the “Timeline” feature is a VS Code’s local version control system that lets you keep track of the changes you make to your files. It’s a great way to keep track of the changes you make to your files and revert to a previous version if you want to.

You can find it under the Timeline tab in the Explorer pane. Here’s how it looks like.

As you can tell, when you expand the “Timeline” tab, you can see the list of snapshots (taken on saving the file) you made to that particular file. You can also see the changes you made (diff) to a file by clicking on the snapshot just like you do in the Source Control tab.

When you hover over a snapshot, you can see the date and time when the snapshot was taken which is pretty useful.

On top of that, the “Timeline” tab also shows the Git commits as well. So, if you’re using Git, you can see the Git commits as well as the snapshots you made to the file. The Git commits are represented by a different icon in the timeline like so as you can see in the above screenshot. The first item in the timeline is the Git commit and the second item is the snapshot.

In closing

All in all, the “Timeline” feature is a great way to keep track of those files that you don’t want to commit to Git such as environment files. And it can definitely save you from a lot of trouble if you ever need to revert back to a previous version of a file in case you messed up something!


Prefer video format instead? Fret not!

Like this article?

Buy me a coffee

👋 Hi there! I'm Amit. I write articles about all things web development. You can become a sponsor on my blog to help me continue my writing journey and get your brand in front of thousands of eyes.

Comments?