Thanks to Stackoverflow
Remove files based on .gitignore:
git rm --cached `git ls-files -i -X .gitignore`
Remove a single file:
git rm --cached mylogfile.log
If it's a directory, just add -r to recusively rm it.
Last active
March 10, 2021 03:18
-
-
Save chengengliu/fcd484f7e7fb1ff95f20c10ab46d9f61 to your computer and use it in GitHub Desktop.
Remove commits remotely without touch local files
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment