Home

Awesome

branch-manager GitHub tag

oh-my-zsh plugin for managing branches

Updating branches can be a pain, especially if you have unsaved changes in your workspace. branch-manager makes it easier to perform updates by auto-stashing your changes before doing routine maintenance, and then returning you to your workspace.

Usage

branch-manager adds the following commands to your shell:

Determining Default Branch

For commands that default to the “default branch” (e.g. master/main), the default branch is determined by checking the following in order:

  1. git config init.defaultBranch
  2. BRANCH_MANAGER_DEFAULT_BRANCH environment variable
  3. …otherwise defaults to master

If it’s guessing wrong, the easiest way to fix it is to set the default branch per repo:

git config init.defaultBranch [your_branch_name_here]

or globally:

git config --global init.defaultBranch [your_branch_name_here]

Installation

branch-manager is built to work with oh-my-zsh, so you’ll need that installed first.

  1. $ cd ~/.oh-my-zsh/custom/plugins (you may have to create the folder)
  2. $ git clone git@github.com:elstgav/branch-manager.git
  3. In your .zshrc, add branch-manager to your oh-my-zsh plugins:
plugins(rails git branch-manager)

Changelog

1.7 April 12, 2024

1.6 October 12, 2022

1.5 September 30, 2022

1.4 September 2, 2021

1.3.1 April 17, 2020

1.3 April 16, 2020

1.2.1 April 14, 2020

1.2 April 14, 2020

1.1.1 October 16, 2017

1.1 October 16, 2017

1.0 February 2, 2016