Skip to content

Latest commit

 

History

History
70 lines (44 loc) · 1.8 KB

README.md

File metadata and controls

70 lines (44 loc) · 1.8 KB

BranchFixer

BranchFixer – fix the mess with master/main git branches.

Do you have multiple repositories with a master and main branches? Do you regularly forget which branch is the "main" in current repo? Well, BranchFixer fixes that!

This tool integrates with .bashrc/.zshrc and keeps track of some git subcommands that require a branch name (switch, checkout, merge, rebase, log are now supported).

If you mistype the branch name, BranchFixer will try to correct the command. For example: You type git switch main, but the main branch does not exist in the current repo – BranchFixer will correct the branch name to master. Thus, git switch master will be executed instead of git switch main.

Installation

There are several ways to integrate BranchFixer into your favorite shell:

zsh

cat z.sh >> "$HOME/.zshrc"

bash

cat ba.sh >> "$HOME/.bashrc"

or simply paste the content of z.sh or ba.sh into your .zshrc/.bashrc file

Network Installation

Also you can install BranchFixer via curl or wget:

Network install and integration into zsh

  • curl
curl -sSf --proto "=https" --tlsv1.2 "https://raw.githubusercontent.com/sigseg5/BranchFixer/master/z.sh" >> "$HOME/.zshrc"
  • wget
wget -qO- --https-only "https://raw.githubusercontent.com/sigseg5/BranchFixer/master/z.sh" >> "$HOME/.zshrc"

Network install and integration into bash

  • curl
curl -sSf --proto "=https" --tlsv1.2 "https://raw.githubusercontent.com/sigseg5/BranchFixer/master/ba.sh" >> "$HOME/.bashrc"
  • wget
wget -qO- --https-only "https://raw.githubusercontent.com/sigseg5/BranchFixer/master/ba.sh" >> "$HOME/.bashrc"

Compatibility

This tool supports these shells and maybe more, who knows:

  • zsh
  • bash