0

I've been trying to find a way to use git with Wordpress in a way that I can have a local directory and sync it to Github without disorganizing XAMPP's file structure. I had the idea of initializing the repo in the theme folder but then I realized that a lot of plugin's keep pertinent data in directories outside the theme folder. For instance if I initialized the theme in the "theme_name" folder it wouldn't carry over data about Advanced Custom Fields which is a plugin I use a lot.

Another idea I had was to initialize the repo from htdocs and use an ignore file to specify which files/directories not to include but I'm not sure which files/directories to exclude. If anyone has an easy way of syncing a Wordpress theme folder with its plugin data to git, it would be really helpful.

2 Answers 2

1

If all you need is plugin and theme why not init git on wp-content folder?

and add ignore files on upload folder and plugin based folder that changes a lot like cache. Ignoring some .md might even reduce your repo size.

some .gitignore like:

/upload/ /cache/ *.md

Sign up to request clarification or add additional context in comments.

Comments

0

Might I suggest utilising a WordPress boilerplate structure like Bedrock?

I've found that this is the best way to make WordPress nicely compatible with modern development tools such as Git and, as a bonus, composer). This will require a bit of learning to adapt to the structure, but Bedrock has fantastic documentation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.