Removing all the files in a branch with git?

113 views Asked by At

Trying to run git rm -r * on a branch. I have dist in .gitignore, but still get this error:

fatal: pathspec 'dist' did not match any files

Thoughts?

1

There are 1 answers

0
Robert Nubel On BEST ANSWER

You're seeing this error because * is actually interpolated by your shell into the list of all files; git doesn't know you're trying to use a wildcard. git rm -r . ("delete all files recursively, starting from this folder") should work instead.