push
Push a feature branch to the remote. Automatically detects the remote type and uses the appropriate push strategy.
Usage
git-loom push [branch]
Arguments
| Argument | Description |
|---|---|
[branch] | Branch name or short ID (optional; interactive picker if omitted) |
Remote Type Detection
Detection priority (first match wins):
- Explicit config —
git config loom.remote-typeset togithuborgerrit - URL heuristics — remote URL contains
github.com→ GitHub - Hook inspection —
.git/hooks/commit-msgcontains “gerrit” → Gerrit - Fallback — Plain Git
Push Strategies
Plain Git (default)
git push --force-with-lease --force-if-includes -u <remote> <branch>
Uses --force-with-lease because woven branches are frequently rebased. --force-if-includes adds extra safety.
GitHub
git push -u <remote> <branch>
gh pr create --web --head <branch>
Pushes the branch, then opens the GitHub PR creation page in the browser. If gh is not installed, the push succeeds with a message suggesting to install it.
Gerrit
git push -o topic=<branch> <remote> <branch>:refs/for/<target>
Uses the refs/for/ refspec and sets the topic to the branch name.
Examples
Push to a plain remote
git-loom push feature-a
# Pushed 'feature-a' to origin
Push to GitHub
git-loom push feature-a
# Pushed 'feature-a' to origin
# (browser opens to PR creation page)
Push to Gerrit
git-loom push feature-a
# Pushed 'feature-a' to origin (Gerrit: refs/for/main)
Interactive selection
git-loom push
# ? Select branch to push
# > feature-a
# feature-b
# Pushed 'feature-a' to origin
Override remote type
git config loom.remote-type gerrit
git-loom push feature-a
# Pushed 'feature-a' to origin (Gerrit: refs/for/main)
Prerequisites
- Must be on an integration branch with upstream tracking
- The target branch must be woven into the integration branch
- Network access to the remote
ghCLI (optional, for GitHub PR creation)