GLI

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:

  1. Create the branch locally.
  2. Push it to your origin remote.
  3. 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-branch

Explicit 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

On this page