---
description: Commit and sync local repository to remote with rebase
---

This workflow automates the process of committing changes and synchronizing with the remote repository. It ensures that remote changes are integrated using rebase and strictly avoids Git LFS.

1. **Stage all changes**
   // turbo
   Run `git add .` to stage all modifications and new files.

2. **Commit changes**
   // turbo
   Generate a descriptive and concise commit message based on the output of `git diff --cached --stat`.
   Then, run `git commit -m "[generated message]"`.
   
   > [!IMPORTANT]
   > Ensure the commit message is meaningful and reflects the architectural impact of the changes.

3. **Fetch and Rebase from remote**
   // turbo
   Run `git pull --rebase` to integrate remote changes.
   
   > [!WARNING]
   > NEVER use `git pull` without `--rebase` or any merge-based strategy. Rebase is the mandatory integration method.
   > NEVER fallback to Git LFS for any file types during this process.

4. **Handle Conflicts (Conditional)**
   If `git pull --rebase` fails due to conflicts:
   - Run `git status` to identify conflicting files.
   - For each conflict, examine the diff and the commit messages of the conflicting changes.
   - If the resolution is deterministic and safe (e.g., trivial additions, non-overlapping changes), resolve the conflicts automatically.
   - If the resolution is ambiguous or involves complex logic, **pause and ask the human to get involved**.
   - In case of particularly complicated or architectural conflicts, suggest the user **contact the Mixio Team** for assistance.
   - After resolution, run `git add .` and `git rebase --continue`.

5. **Push to remote**
   // turbo
   Once rebase is complete and all tests pass (if applicable), run `git push`.
   
   > [!IMPORTANT]
   > If the push fails due to **GitHub file size restrictions** (e.g., file larger than 100MB):
   > - **DO NOT** attempt to use OR install Git LFS.
   > - **DO NOT** fallback to any large file storage mechanisms.
   > - Inform the user immediately and suggest they **contact the Mixio Team** to resolve the repository structure or storage strategy.

> [!CAUTION]
> If at any point the synchronization fails beyond a simple conflict resolution, notify the user immediately and do not attempt destructive recovery actions.
