Skip to content

Instantly share code, notes, and snippets.

@williamluisan
Last active April 3, 2021 09:01
Show Gist options
  • Save williamluisan/332b8c9b503eb67188cc0f08e12d3b37 to your computer and use it in GitHub Desktop.
Save williamluisan/332b8c9b503eb67188cc0f08e12d3b37 to your computer and use it in GitHub Desktop.
Gitignore reset cache
### STEP 1 ###
Adding "your path to file" you want to ignore in .gitignore
### STEP 2 ###
(choose one of the options)
# option(1) (recommended) Remove the cache of all the files
git rm -r --cached .
# option(2) Remove the cache of specific file
git rm -r --cached <file_name.ext>
### STEP 3 ###
git add -A
### STEP 4 ###
git commit -m "Update .gitignore and refresh cache"
### STEP 5 ###
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment