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
Clone the GitLock extension repository.
git clone https://github.com/gosamab/gitlock
cd gitlock
Install dependencies:
npm install
Compile the extension:
npm run build
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
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.
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.
View Locked Files
Open the Command Palette and select GitLock: List Locked Files.
Choose a file from the list to open it.
Conflict Detection
If a file is locked by another user, a warning will appear when you try to edit or lock the file.
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.