How to open a .lock file
Quick, free ways to open Lockfile on any system.
A .lock file is a Dependency Lockfile / Lock Marker. If double-clicking does nothing, your computer simply does not have an app that reads Lockfile yet. Here is how to fix that on each operating system, using free software wherever possible.
Open a .lock file step by step
- Confirm the file really is a .lock. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
- On Windows, open it with any text editor (to inspect).
- On Mac, use any text editor (to inspect).
- On Linux, try any text editor (to inspect).
- Still stuck? Search for a dedicated Lockfile viewer.
Best apps to open .lock files
Windows
- any text editor (to inspect)
macOS
- any text editor (to inspect)
Linux
- any text editor (to inspect)
Frequently asked questions
Why can't I open my .lock file?
Almost always because no installed app understands Lockfile. Install one of the apps above, or convert the file to a format your existing software already reads.
Should I commit lockfiles to git?
For applications, yes: yarn.lock, Cargo.lock and friends guarantee identical installs for the whole team and CI. Libraries sometimes leave them out; follow your ecosystem's convention.
Can I delete a .lock file?
A dependency lockfile: only if you intend to re-resolve all versions on the next install. A lock marker: only when the program that created it is not running, otherwise it is protecting something.