-2

In my .gitignore file, I just have gulp. Yet after git ls-tree -r dev --name-only reveals that it still tracks that folder. Why?

I tried to write /gulp instead of gulp, to no avail.

FILES

.GITIGNORE

Maroun
  • 94,125
  • 30
  • 188
  • 241
drake035
  • 3,955
  • 41
  • 119
  • 229

1 Answers1

2

Step 1: Commit all your changes

Before proceeding, make sure all your changes are committed, including your .gitignore file.

Step 2: Remove everything from the repository

To clear your repo, use:

git rm -r --cached .

rm is the remove command

-r will allow recursive removal

–cached will only remove files from the index.

Your files will still be there but the rm command can be unforgiving. If you wish to try what it does beforehand, add the -n or --dry-run flag to test things out.

Step 3: Re add everything

git add .

Step 4: Commit

git commit -m ".gitignore fix"
klugjo
  • 19,422
  • 8
  • 57
  • 75