Skip to content

Instantly share code, notes, and snippets.

@Alhomaidhi
Created February 24, 2023 23:42
Show Gist options
  • Save Alhomaidhi/36090ef2ec610d9b6d7a2a8a3726fd04 to your computer and use it in GitHub Desktop.
Save Alhomaidhi/36090ef2ec610d9b6d7a2a8a3726fd04 to your computer and use it in GitHub Desktop.
Remove cached file from repo
## Use when updating '.gitignore' and wanting the changes to reflect on the repo
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment