Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>GitLockNew to Visual Studio Code? Get it now.
GitLock

GitLock

Osama Azab

|
14 installs
| (0) | Free
An extension that adds checkout and checkin functionality to a git repository
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GitLock

GitLock is a Visual Studio Code extension that provides file-locking capabilities for collaborative Git workflows. It helps teams avoid conflicts by allowing users to lock files they are editing, preventing others from making changes until the file is unlocked.


Features

File Locking and Unlocking

  • Lock files to signal ownership while editing.
  • Unlock files to release ownership when done.

Conflict Detection

  • Warn users when attempting to edit or lock files that are already locked by others.

Status Bar Indicator

  • Displays the lock status of the active file (🔒 Locked or 🔓 Unlocked).
  • Tooltip provides more details about the status.

List Locked Files

  • View all locked files in the repository.
  • Quickly navigate to locked files from the list.

Requirements

  • Node.js and npm must be installed for extension development.
  • A Git repository initialized in the project workspace.
  • Ensure git is available in your system's PATH.

Installation

  1. Clone the GitLock extension repository.
    git clone https://github.com/gosamab/gitlock
    cd gitlock
    
  2. Install dependencies:
    npm install
    
  3. Compile the extension:
    npm run build
    
  4. Run the extension in a new VS Code window:
    • Open the project in VS Code.
    • Press F5 to launch the Extension Development Host.

Extension Settings

GitLock currently does not introduce custom settings but relies on the following standard configurations:

  • Git Integration: Ensure your Git is correctly configured and authenticated for the repository.

Usage

  1. Lock a File

    • Open a file.
    • Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
    • Select GitLock: Lock File.
    • The file will be locked, and a .lock file will be created and pushed to Git.
  2. Unlock a File

    • Open the file to unlock.
    • Open the Command Palette and select GitLock: Unlock File.
    • The .lock file will be removed and changes pushed to Git.
  3. View Locked Files

    • Open the Command Palette and select GitLock: List Locked Files.
    • Choose a file from the list to open it.
  4. Conflict Detection

    • If a file is locked by another user, a warning will appear when you try to edit or lock the file.
  5. Status Bar Indicator

    • The status bar shows the lock status of the active file.

Known Issues

  • Lock files are visible in the repository, which might be confusing for users unfamiliar with GitLock.
  • Manual deletion of .lock files outside GitLock may lead to inconsistencies.

Release Notes

1.0.0

Initial release of GitLock with the following features:

  • File locking and unlocking.
  • Conflict detection.
  • Status bar indicator.
  • List locked files command.

Extension Guidelines

Ensure that you've read through the extension guidelines and follow the best practices for creating your extension.

  • Extension Guidelines

For More Information

  • Visual Studio Code's Markdown Support
  • Markdown Syntax Reference

Enjoy using GitLock!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft