Branch Management
Create and switch branches effortlessly.
gli simplifies branch management by automatically handling upstream tracking and remote creation.
Switch & Create
The -s (switch) command creates a new branch if it doesn't exist, and switches to it.
gli -s <branch-name>
# or
gli --switch <branch-name>Default Behavior
If neither -lb nor -rb is specified, gli -s defaults to a Remote Push (-rb). It will:
- Create the branch locally.
- Push it to your
originremote. - Set upstream tracking automatically.
Note
The -s command is designed for creating and switching to new branches.
Local-Only Branch
Create a branch locally without pushing to remote.
gli -s "experiment/test" -lb
# or
gli -s "experiment/test" --local-branchExplicit Remote Push
Force a push to remote (same as default behavior, but explicit).
gli -s "fix/bug-123" -rb
# or
gli -s "fix/bug-123" --remote-branch