1

I have below git .gitignore file for wordpress site.


# ignore everything in the root except the "wp-content" directory.
!wp-content/

# ignore everything in the "wp-content" directory, except:
# "mu-plugins", "plugins", "themes" directory
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/

# ignore these plugins
wp-content/plugins/hello.php

# ignore specific themes
wp-content/themes/twenty*/

# ignore node dependency directories
node_modules/

# ignore log files and databases
*.log
*.sql
*.sqlite

Now when I made some change to my wp_config.php file or any other file out of wp-content folder git count the file for change and popup the option to commit the change. I am using VS code editor.

1 Answers1

1

Did you create the .gitignore file after you initialised the repo (ran git init)?

If yes then you need to clear Git's cache. Try run git rm -r --cached . on the command line.

MeltingDog
  • 14,310
  • 43
  • 165
  • 295