https://github.com/hueyyeng/lock-file-smith
Simple wrapper for Git LFS (Large File Storage) commands
https://github.com/hueyyeng/lock-file-smith
Last synced: 7 months ago
JSON representation
Simple wrapper for Git LFS (Large File Storage) commands
- Host: GitHub
- URL: https://github.com/hueyyeng/lock-file-smith
- Owner: hueyyeng
- License: mit
- Created: 2023-09-07T09:12:10.000Z (about 2 years ago)
- Default Branch: develop
- Last Pushed: 2023-09-14T10:46:22.000Z (about 2 years ago)
- Last Synced: 2025-02-17T23:35:54.748Z (8 months ago)
- Language: Python
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lock-file-smith
Simple wrapper for Git LFS (Large File Storage) commands.
## Quickstart
As there is no API for interacting with Git LFS, this wrapper provides function that
you can use in your Python application for querying, lock/unlock Git LFS files etc.The `LockFile` dataclass stores the name, author and ID of a locked file.
Take note that the speed of this library depends on Git. This has not been tested on
a Git repository with a large number of locked files.## Usage
```python
from lockfilesmith.cmds import lock, query# Use this to verify if Git/Git LFS is presence
query.is_git_installed()
query.verify_git_lfs()# Query for locked files.
locked_files = query.locked_files() # Will return empty list if no locked files# Lock a file (ensure the file format is tracked as LFS)
lock.lock_file("foo/bar.uasset") # True# Unlock file (you can retrieve the locked object ID using query.locked_files)
bar = query.locked_files()[0] # assume bar.uasset is the only locked file
lock.unlock_file(bar.id)
```## Further reading
[https://git-lfs.com/](https://git-lfs.com/)
[https://www.atlassian.com/git/tutorials/git-lfs](https://www.atlassian.com/git/tutorials/git-lfs)