This topic is locked

Best Git workflow for PHPRunner when using Codex or Claude Code?

6/2/2026 13:00:59
PHPRunner General questions
F
Fouad author

Hi everyone,

I am using PHPRunner with Git version control enabled, and I am trying to find the safest workflow when also using AI coding tools such as Codex or Claude Code.
My current setup is that PHPRunner exports the project files to a local Git folder and then commits/pushes to my GitHub repository.

The problem is this:
If I modify or add files directly in GitHub, or with Codex/Claude Code, and then later click “Save and Commit” in PHPRunner, PHPRunner may overwrite or delete those external changes because it exports its own project state back into the repository.

I want to avoid losing changes.

For those of you using PHPRunner + GitHub + AI coding tools:

  • Do you let PHPRunner commit directly to main, or do you use a separate branch?
  • Do you disable “update on each project opening”?
  • Do you use custom Git commands for commit/update?
  • Do you let AI tools edit PHPRunner files like project.json, table*.json, event*.json, or only external PHP/CSS/JS files?
  • What is your safest workflow to merge PHPRunner changes with external code changes?

I am considering this workflow:
PHPRunner commits to a dedicated branch like phprunner-sync
AI/Codex/Claude changes are made on another branch
Changes are reviewed and merged into main only after testing
Avoid direct edits to PHPRunner-generated JSON files outside PHPRunner

Is this the right approach, or is there a better workflow used by experienced PHPRunner developers?
Thanks in advance for sharing your setup and best practices.

Screenshot 2026-06-02 210032.png
ChatGPT 6/2/2026

Your approach to managing PHPRunner with Git and AI coding tools is well thought out, and you’re on the right track with your considerations. Here are some insights and best practices that can help you refine your workflow:

Recommended Workflow

  1. Use Separate Branches:

    • Your idea to have a dedicated branch for PHPRunner changes (e.g., phprunner-sync) and a separate branch for AI-generated code (e.g., ai-code) is sound. This isolation helps you manage and review changes effectively before merging into the main branch.


  2. Avoid Direct Edits to PHPRunner-Generated Files:

    • It's a good practice to avoid editing PHPRunner-generated files (like project.json, table_*.json, event_*.json) directly outside of PHPRunner. If you need to make changes, do them within PHPRunner to prevent conflicts and overwrites.


  3. Disable Automatic Updates:

    • Disabling the “update on each project opening” option in PHPRunner can help you avoid unintended overwrites when you open the project after making external changes. Instead, you can manually sync changes when you're ready.


  4. Custom Git Commands:

    • Using custom Git commands can give you more control. You might consider using git stash to temporarily save changes in your working directory before opening PHPRunner. After making your changes in PHPRunner and committing them, you can apply your stashed changes back.


  5. Review and Testing:

    • Always review changes from both branches before merging into the main branch. Automated tests and manual testing of the integrated changes can help ensure stability.


  6. Use Pull Requests:

    • Use pull requests (PRs) in GitHub for merging changes from your phprunner-sync or ai-code branches into the main branch. This allows for code review, discussion, and easier management of conflicts.



Detailed Workflow Steps

  1. Branching Strategy:

    • Create a branch for PHPRunner (phprunner-sync) and another for AI-generated code (ai-code).
    • Regularly pull changes from the main branch into your working branches to keep them up to date.


  2. Editing Workflow:

    • Make edits in PHPRunner and commit to phprunner-sync.
    • Use AI tools to create or modify code in the ai-code branch.


  3. Sync Changes:

    • Before merging into main, ensure both branches are up to date with main.
    • Resolve any conflicts that arise during merging.


  4. Testing:

    • Deploy changes to a staging environment for testing before merging to main.


  5. Merging:

    • Once testing is complete, merge the changes from phprunner-sync and ai-code into main using pull requests.



Conclusion

Your planned workflow is a solid approach that emphasizes safety and control over your codebase. By keeping PHPRunner-generated files out of direct edits and utilizing a branching strategy, you can mitigate the risks associated with overwriting changes. Regular testing and reviews will further enhance the reliability of your development process.