Skip to content

Instantly share code, notes, and snippets.

@Fakesum
Created March 30, 2025 13:01
Show Gist options
  • Save Fakesum/880c7378415141e331315f19de6e4d40 to your computer and use it in GitHub Desktop.
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.
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