I'm a Git beginner with workflow questions. I've learned lots of commands, and I know how things work, but I can't seem to figure out the right workflow. Love to have some suggestions. [Note, I'm the only developer working on my projects]
A friend once told me that it was best to work on the live server rather that on localhost to avoid running into environment specific issues. This true?
I use the same base theme for all of my Drupal sites. When I make a change in one, I currently need to copy and paste it to about 10 other places. Is there a way keep this base theme in one place and have other sites draw from it? Github maybe?
If I want to do a 'complete' backup of the codebase and the database - the only way to do this is to export the database as a sql file and commit the whole thing?
Thanks for the help!
Terry
In general, you should run testing on a server as close to the production server as possible, but not the actual live server, as that'll break a live site during testing. Because Drupal is designed to run well on a variety of servers, using similar servers isn't as relevant.
You should use git pull instead of copy-paste. Because git has a decentralized designed, you don't really need a central location like github. If that's useful for your workflow, use it, but if not, you can pull directly from one server to another.
There's not a great solution to Drupal storing so much configuration information in the database and keeping that synched. Syncing your entire database is one approach. Many modules also have exportables, which basically save data from the database into code so you can sync it along with the rest of your code. Features is probably the simplest way to experiment with the exportable model and see if that works for you.
If you're new to the whole idea of version control systems, you're probably better off just jumping in with both feet. It will all start to make sense as you go. And of course, by its very nature you're unlikely to do any permanent damage since you can roll back and forth.
One firm recommendation: commit frequently. Every time you make a change that works, commit. Smaller commits are much easier to handle than large ones. For example, if you need to undo a broken change, you're much more likely to be able to undo it without removing a heap of working code that was committed at the same time if your commits are atomic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With