Created
October 26, 2018 19:34
-
-
Save MahmoudDolah/c378b5d26b41e02ed372b7ec7af59714 to your computer and use it in GitHub Desktop.
Shell function to fuzzy search your branches (insert this into your bashrc / zshrc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fbr() { | |
git fetch | |
local branches branch | |
branches=$(git branch -a) && | |
branch=$(echo "$branches" | fzf +s +m -e) && | |
git checkout $(echo "$branch" | sed "s:.* remotes/origin/::" | sed "s:.* ::") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment