简体   繁体   中英

How to set up git for wordpress theme development

I am setting up 10 new local wordpress sites. I have 10 folders all named like this:

"name-of-site.com"

Inside each is a simple file structure:

  • briefing files
  • html
  • wordpress

I want to set up a repository on git hub for the wp-content file but I can't find a way to create an alias. Surely the end result will be 10 different repos all called "wp-content"

How can I set up a separate repo for each wp-content folder and name it "name-of-site.com"

Is this glaringly obvious and I am being really stupid???

Why not have the top level folted, that is "name_of_site.com" be the repository, and in that folder, you can create a .gitignore file to ignore the other directories you don't want, that is, the html and briefing files (if I understand your layout correctly). That way, you're simply tracking the Wordpress content. You can even move it up a level so that only the briefing files and the HTML are in separate directories and the WP content is in the "name_of_site.com" directory.

Edit:

After your comments, I think you could do it this way:

  • Create repos for each site you have and put the wp-content of those sites in the .gitignore file

  • Create one repo for wp-content, which contains all your themes. Organize them according to your needs.

  • Write a simple shell script that pulls the latest theme into your site's folder from the repo in the previous step. That way, every time you update your theme, you can go to your chosen site and just synch up with the latest pushed version.

Does that make sense?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM