Last active
July 30, 2019 13:40
-
-
Save imghasemi/a0ad7e09047054b41d4f3ebe48389ed0 to your computer and use it in GitHub Desktop.
Remove a file from a Git repository without deleting it from the local filesystem
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
# good solution described here: https://stackoverflow.com/a/21477287 | |
# This command removes files from the repository based on your .gitignore without deleting them from the local file system : | |
git rm --cached `git ls-files -i -X .gitignore` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment