If you have a new WordPress install on WPCD but you don’t have an associated repository yet and you don’t plan on using a local development environment, how can you use the WPCD Git Integration?
In this case you would do the following:
Let’s say you only have one or two plugins you want to keep under git control – how would you go about doing that?
The key here is the .gitignore file.
In there you would add the following at the top:
# Ignore everything * # Except the files in the my-plugin folder !/wp-content/plugins/my-plugin/ !/wp-content/plugins/my-plugin/**
This works because the first line * ignores all files, and the next two lines, !/wp-content/plugins/my-plugin/ and !/wp-content/plugins/my-plugin/** un-ignore the my-plugin folder and all the files inside it.
Then, you would initialize the site with your git repo containing this file.
When you use our GIT SYNC process, it will only sync the plugin files you’re interested in from the current branch.
Note: With something like this, you do NOT want to ever use the FETCH EXISTING TAG (VERSION) FROM REPO or FETCH AND APPLY TAG (VERSION) actions. So please be careful with those.