Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)

I have following in .gitignore:

wordpress/*

!wordpress/wp-content/themes/my-theme/

!wordpress/wp-content/themes/my-theme/*

But when I do git status it's not seeing the untracked files.

What did I do wrong?

1 Answer

0 votes
by (119k points)

I believe you want something like

!/wordpress

/wordpress/*

!/wordpress/..../

But, my preferred solution is to add files I want to track. I would do in ignore (either .git/info/exclude for just you or .gitignore for everyone):

/wordpress/*

And then run

git add -N path/to/files/to/track

Also, check out this Git Tutorial to know more.

Browse Categories

...