Last active
May 30, 2018 18:25
-
-
Save gajoseph/8c9f1fc13ceef268ef8ec793a2de4d42 to your computer and use it in GitHub Desktop.
safely delete a file from git repository,
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
### GIt prem delete a file | |
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all | |
rm -rf .git/refs/original/ | |
### prune entries older than the specified time | |
git reflog expire --expire=now --all | |
### Cleanup unnecessary files and optimize the local repository; prune object older than now | |
git gc --prune=now | |
### | |
git gc --aggressive --prune=now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment