1

I was thinking about sending all the files in my dev environment, including a copy of the database I use locally and the files used in my environment, so the other developer could use it instead of copy the production version because it's too big. My idea is to do this:

Development: Track all files including wp-content/uploads

Production: Receive all files except from wp-content/uploads

I can't include this folder in .gitignore because I want to upload it to the repository, but I need to exclude this content from the production because on the server I'm using a webhook and git pull to update the live site. How would you solve this?

f4ssb3nd3r
  • 43
  • 5

1 Answers1

0

I'd put the development-only files into a git submodule. That is a separate repo which is referenced by the main repo. Then when you git pull the main repo into your production environment, you don't need to pull the development data at all.

You could also make a development-only repo which has the main repo as its submodule instead. This is relevant if you may want to have several different development/testing/CI setups--you can have as many as you want, all referring to the same main repo as a submodule.

https://git-scm.com/book/en/v2/Git-Tools-Submodules

John Zwinck
  • 239,568
  • 38
  • 324
  • 436