Created
March 30, 2025 13:01
-
-
Save Fakesum/880c7378415141e331315f19de6e4d40 to your computer and use it in GitHub Desktop.
Single Command to stop tracking any file in git above 50MB, to fix messed up git instances.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Recurse -File | Where-Object { $_.Length -gt 50MB } | ForEach-Object { $_.Name >> .gitignore; git rm --cached $_.FullName }; git commit -m "Stop tracking files >50MB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment