Skip to content

Fix the mess with master/main git branches. BranchFixer is a practical tool designed to streamline Git workflows by automatically correcting branch name errors in repositories with both 'master' and 'main' branches, integrating seamlessly with .bashrc/.zshrc

License

Notifications You must be signed in to change notification settings

sigseg5/BranchFixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Fix the mess with master/main git branches. BranchFixer is a practical tool designed to streamline Git workflows by automatically correcting branch name errors in repositories with both 'master' and 'main' branches, integrating seamlessly with .bashrc/.zshrc

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages