# Syncing Odoo-Modules across machines (Mac + Windows) Each module/suite folder here is its **own git repo** (private on GitHub at `gsinghpal/`, mirrored to gitea `admin/`). This parent folder is a separate repo that holds the shared files (CLAUDE.md, docs, scripts, these sync helpers). The cloud (GitHub) is the hub: both machines push to it and pull from it. Nothing here ever deletes your work. Pulls are fast-forward only, so local changes are never overwritten; pushes only send commits. ## First-time setup on a new machine (e.g. the Windows PC) 1. Install **Git** (Git for Windows includes "Git Bash", which runs these scripts). 2. Sign in to GitHub once so git can push/pull: - easiest: `gh auth login` (or let Git Credential Manager prompt on first pull) 3. Get everything: ``` git clone https://github.com/gsinghpal/Odoo-Modules.git cd Odoo-Modules bash sync-clone-all.sh ``` That clones the parent, then all 49 module repos into place. (gitea is an optional second mirror. The first push to it will ask for your `git.nexasystems.ca` login. If you only use GitHub, those gitea lines just fail quietly and GitHub stays the source of truth.) ## Daily workflow (same on Mac and Windows) - **Before you start:** `bash sync-pull-all.sh` - pulls the latest for the parent and every module. Anything with local changes or a diverged history is skipped and listed, so you can handle it yourself. - **Do your work**, then **commit inside the module(s) you changed**: ``` cd fusion_clock git add -A git commit -m "..." cd .. ``` - **When done:** `bash sync-push-all.sh` - pushes every committed change to GitHub + gitea, and flags any repo that still has uncommitted changes (so nothing is silently left behind). ## Golden rule for two machines Push from the machine you worked on **before** you switch to the other one, and run `sync-pull-all.sh` on the other machine **before** you start. That keeps both in sync and avoids diverged histories. ## Helper scripts | Script | What it does | |--------|--------------| | `sync-clone-all.sh` | Clone any module repo listed in `repos.txt` that isn't here yet. | | `sync-pull-all.sh` | Fast-forward pull the parent + all modules (safe, never clobbers). | | `sync-push-all.sh` | Push committed work for the parent + all modules to GitHub + gitea. | | `sync-refresh-list.sh` | Rebuild `repos.txt` from the repos present here (after adding/removing a module). | | `repos.txt` | The list of module repo names the scripts act on. |