/git-lfs-lock-pre-commit-hook

A pre-commit hook to avoid committing locked files (for Git LFS users)

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Git LFS File Locking pre-commit Hook

This pre-commit hook avoid you to commit locked files when you are using the File Locking functionality of Git LFS.

rejected commit screenshot

How To Use

Linux / BSD / Mac OS X / Windows with Python

Simply copy the pre-commit file in the .git/hooks/ folder of your target repository:

cp path/to/git-lfs-lock-pre-commit-hook/pre-commit .git/hooks/

On Unix systems (Linux, Mac OS X,...), be sure to make this script executable:

chmod +x .git/hooks/pre-commit

That's it.

Windows without Python

For Windows users that cannot / do not want to install Python, a sand alone version is available in the dist\ folder. Simply copy pre-commit.exe in the .git\hooks\ folder of your Git repository.

Building The Stand Alone Version

To build the stand alone version, you first need to install Python and then to install PyInstaller:

pip install pyinstaller

Finally just build the executable, with GNU make, if available:

make

or manually, if you do not have GNU make:

pyinstaller -F pre-commit

Changelog

  • 1.0.1: Fixes deadlock on large git command output
  • 1.0.0: Initial release