Rebase the current branch on top of a base reference, automatically handling common inGitDB-specific conflicts.
The following types of files can have their conflicts automatically resolved by ingitdb:
README.mdfiles (for collections, views, triggers, etc.)- Materialized views
- Data indexes
ingitdb rebase [--base_ref=REF] [--resolve=FILES]| Flag | Description |
|---|---|
--base_ref |
Git branch or commit to rebase onto. If omitted, falls back to BASE_REF or GITHUB_BASE_REF environment variables. |
--resolve |
Comma-separated list of file names to auto-resolve during merge conflicts. Defaults to none. In internal tooling, setting to readme is used. |
The rebase command runs a git rebase <base_ref> operation under the hood. If a git conflict is encountered during the rebase procedure, ingitdb performs an automatic check to determine if the conflict can be safely resolved without human intervention.
When git rebase stops due to a conflict, ingitdb evaluates the unmerged files:
- It executes
git diff --name-only --diff-filter=U. - It verifies if the conflicting files are safe to overwrite. Specifically, if the conflict is solely within collection
README.mdfiles (and the--resolve=readmeflag is provided), the CLI automatically resolves the issue by internally invoking the same logic used by thedocs updatecommand. - The shared internal function detects the specific collections the
README.mdfiles belong to, and knows to update only the problematic ones instead of regenerating the entire database documentation.- 🔗 See Implementation: The logic for matching conflicted files to their respective collections is implemented in
docsbuilder.FindCollectionsForConflictingFiles.
- 🔗 See Implementation: The logic for matching conflicted files to their respective collections is implemented in
ingitdbstages the auto-resolved files (git add) and resumes the operation withgit rebase --continue.
If any conflicts exist outside of the explicitly resolvable files (e.g., in a collection.yaml or a Golang source file), the rebase command will immediately abort and list the unresolved files, requiring manual resolution by the user.