Skip to content

Instantly share code, notes, and snippets.

@ainsofs
Created April 16, 2015 01:50
Show Gist options
  • Select an option

  • Save ainsofs/2b80771a5582b7528d9e to your computer and use it in GitHub Desktop.

Select an option

Save ainsofs/2b80771a5582b7528d9e to your computer and use it in GitHub Desktop.
Clear .gitignore cache
# 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"
@charanjit-singh
Copy link
Copy Markdown

👍

@stephen-ifmacinema
Copy link
Copy Markdown

Great

@tiagobbraga
Copy link
Copy Markdown

👍

@Daniel-Monroy
Copy link
Copy Markdown

Great !!

@luisgagocasas
Copy link
Copy Markdown

👍

@angelzarazua
Copy link
Copy Markdown

Nice!

@DmmitryIs
Copy link
Copy Markdown

Like

@ducnpdev
Copy link
Copy Markdown

Like

@akshuvo
Copy link
Copy Markdown

akshuvo commented Mar 14, 2022

Run all command together at once:
git rm -r --cached . && git add . && git commit -m ".gitignore is now working"

@Abimomin
Copy link
Copy Markdown

Abimomin commented Jun 3, 2022

@akshuvo this command deleted all the files of my git repository

@akshuvo
Copy link
Copy Markdown

akshuvo commented Jun 3, 2022

@Abimomin This is just a short version of the code which showed in the gist. Maybe you didn't push your codes or something went wrong.

@mutalibcs
Copy link
Copy Markdown

remove all files from git cache

Just copy these command & fixed the problem.

git rm -r --cached .
git add .
git commit -m "untracked fixed"

@ElWazy
Copy link
Copy Markdown

ElWazy commented Mar 28, 2023

👍

@muhamad-andhika-bagaskara
Copy link
Copy Markdown

image

@Sherlockboy
Copy link
Copy Markdown

👍

@lba-source-code
Copy link
Copy Markdown

helpful information, massive thanks!

@aamahi
Copy link
Copy Markdown

aamahi commented Dec 19, 2023

Nice!!! It's working good.

@chadhumphrey
Copy link
Copy Markdown

easy peasy, lemon squeezy!

@juanmaluzzi-uala
Copy link
Copy Markdown

thank you!

@michalis-papamichael
Copy link
Copy Markdown

thanks

@ARAGORN212
Copy link
Copy Markdown

is good dude, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment