How to manage OJS with Git?

I’m looking to begin managing the entire application git but I’m a little inexperienced with how this might look. I’m familiar with Git-CLI but have mainly interfaced with a serverless architecture that pulls from a git repo rather than a PHP server environment. What cued this is that I’d like to begin tracking changes made to configuration and theme files in a granular way, rather than incrementally with backups. I’ll include a few questions below that I hope might be helpful to others in case someone has answers:

  1. What should .gitignore include in a typical OJS installation?
  2. What is a good workflow for pushing local changes to the server? In my case, I’m using a LAMP stack. Should I store everything in a remote like Github and then pull changes to my server? Or should I push changes directly to my server? Or should I make changes locally, then upload via FTP, using git for version control only? I’m curious on pros/cons if anyone has ideas.
  3. How would I pull updates via git from the main OJS repo when they’re released for upgrading?

Some of these questions may be too complicated for one post, I’m not sure. I would appreciate any advice offered. Perhaps git isn’t even the solution for what I’m trying to accomplish.

Hi @benaltair,

There is a topic related to OJS and git: Running production OJS site with Git for Dummies (like me)

  1. Depends on what the purpose is. According to what you’ve described, I don’t think you’d need any additions there.
  2. I’d fork the repo and track own fork, rather than pkp/ojs repo (for the purposes described). Thus, if any changes to the original code needed, it’s possible to keep them on your fork and reapply every time OJS upgrade needed. E.g., on own fork the branch called stable-3_2_1-modified is created, which origins from pkp/ojs repo stable-3_2_1 branch with custom changes. Crucial update for this branch is available → just update the fork and rebase own stable-3_2_1-modified on top of the stable-3_2_1 from pkp/ojs. But I must confess that don’t upgrade via git production instances of OJS.
1 Like

Thanks, I had looked through a few dozen posts but didn’t see this one! I think that covers most of what I need to get started :pray:t2: