From 05ff5e3aa3b938cea88a0a9da837e374cee90458 Mon Sep 17 00:00:00 2001 From: Josh-Tech Date: Fri, 26 Sep 2025 01:05:50 +0300 Subject: [PATCH] GitScripts --- Readme.md | 18 +++++++++--------- git-lfs-fix-attributes.ps1 | 1 + git-lfs-unlock-unchanged.ps1 | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Readme.md b/Readme.md index fa07ae7..8543c1b 100644 --- a/Readme.md +++ b/Readme.md @@ -1,10 +1,10 @@ -# Steve's Git (LFS+Locking) Helper Scripts +# Joseph's Git (LFS+Locking) Helper Scripts This is a collection of Powershell scripts I use to help me manage a few tricky Git repo tasks, mostly those related to using [Git LFS](https://git-lfs.github.com/) -and its [file locking feature](https://github.com/git-lfs/git-lfs/wiki/File-Locking). +and its [file locking feature](https://github.com/git-lfs/git-lfs/wiki/File-Locking). -All these scripts work with the regular Powershell 5.1 shipped with Windows 10, +All these scripts work with the regular Powershell 5.1 shipped with Windows 10, but should also work fine with later versions. Wrapper .bat files are provided in case you want to call these from somewhere @@ -28,10 +28,10 @@ Options: -help : Print this help ``` -I added a feature to the [UE4 Git LFS Plugin](https://github.com/SRombauts/UE4GitPlugin) -which automatically unlocked files on push, this script is a version of that you +I added a feature to the [UE4 Git LFS Plugin](https://github.com/SRombauts/UE4GitPlugin) +which automatically unlocked files on push, this script is a version of that you can run from anywhere. I find it useful when running a mixture of in-UE and -out-of-UE workflow. +out-of-UE workflow. It figures out which lockable LFS files you're pushing, and unlocks them if the push was successful, so long as you don't have further uncommitted @@ -41,7 +41,7 @@ modifications. If you suspect that you have some file locks you don't need, run this command and it will unlock anything you have locked, which you don't have outstanding -changes for. +changes for. ``` Usage: @@ -61,7 +61,7 @@ remote yet. ## Fix file attributes Git LFS makes lockable files read-only on checkout or unlock to prevent -accidental changes. Sometimes the attributes can get out of sync though, +accidental changes. Sometimes the attributes can get out of sync though, so this script checks them all and fixes where necessary. ``` @@ -73,4 +73,4 @@ Options: -dryrun : Don't perform actions, just report what would happen -verbose : Print more -help : Print this help -``` \ No newline at end of file +``` diff --git a/git-lfs-fix-attributes.ps1 b/git-lfs-fix-attributes.ps1 index 1f7004d..c19eae7 100755 --- a/git-lfs-fix-attributes.ps1 +++ b/git-lfs-fix-attributes.ps1 @@ -67,3 +67,4 @@ if ($numFixed -gt 0) { } else { Write-Output "All file attributes are OK" } + diff --git a/git-lfs-unlock-unchanged.ps1 b/git-lfs-unlock-unchanged.ps1 index 0f640d9..ff5b08b 100755 --- a/git-lfs-unlock-unchanged.ps1 +++ b/git-lfs-unlock-unchanged.ps1 @@ -77,3 +77,4 @@ if ($filesToUnlock.Count -gt 0) { } } } +