1

I have several subfolders in various parts of my project called "autosave" and I want .gitignore to ignore any subfolder called "autosave" regardless of where it is in the project, how would I do this?

I am kinda new with git but I did try */autosave/ but that doesn't appear to work. Also, some are capitalized and some aren't (Autosave and autosave).

1

1 Answer 1

1

A simple line should be enough

autosave/
Autosave/

That will ignore any autosave folder (anywhere).
It should be the equivalent of **/autosave/

See gitignore pattern format:

If the pattern ends with a slash, it is removed for the purpose of the following description, but it would only find a match with a directory.

In other words, foo/ will match a directory foo and paths underneath it, but will not match a regular file or a symbolic link foo (this is consistent with the way how pathspec works in general in Git).

1
  • doh, i knew it would be simple, thank you so much, VonC! Commented Jun 14, 2019 at 5:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.