gitconfig: improve rbm alias base detection
User description
Let rbm resolve master/main from local refs first, then fall back to the remote default branch chosen via origin/HEAD (including remote-only refs). Forward all user-supplied arguments to git rebase so the alias mirrors the native command’s behavior.
GitHub Copilot Summary:
This pull request updates the
rbmgit alias in thegitconfigfile to make it more robust and flexible when rebasing onto the main development branch. The new alias now better detects whether the main branch is namedmasterormain, and also supports rebasing onto the corresponding remote branch if the local branch doesn't exist.Improvements to git alias functionality:
- Updated the
rbmalias to dynamically detect the default branch (masterormain) both locally and on the remote, and to fall back to the appropriate remote branch if needed. This makes the alias more reliable in repositories that use different naming conventions for the main branch.
PR Type
Enhancement
Description
-
Improved
rbmalias to detect default branch fromorigin/HEADfirst -
Falls back to local
master/mainbranches if remote default unavailable -
Supports remote-only branches when local equivalents don't exist
-
Forwards all user arguments to
git rebasecommand
Diagram Walkthrough
flowchart LR
A["origin/HEAD<br/>symbolic ref"] -->|Extract remote branch| B["Check if master/main"]
B -->|Found locally| C["Use local branch"]
B -->|Not found locally| D["Use remote branch"]
D -->|Still not found| E["Fallback to<br/>master/main"]
E -->|Not found| F["Error"]
C --> G["git rebase<br/>with all args"]
D --> G
File Walkthrough
| Relevant files | |||
|---|---|---|---|
| Enhancement |
|
Summary by CodeRabbit
- Chores
- Enhanced the
rbmGit alias for improved base branch detection. Now intelligently derives the base branch from remote origin HEAD with fallback logic to master or main branches, providing more robust handling of edge cases and remote branch naming.
- Enhanced the