From 2dc1a2f98b5d697e713e5fc8cd81c71e7621f68b Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Sat, 20 Aug 2022 16:33:09 +0100 Subject: [PATCH] adding bash_profile --- .bash_profile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .bash_profile diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..19a1672 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,15 @@ +function _branches() { + if [ -n "$1" ]; then + echo "$1" + return + else + git for-each-ref --sort=committerdate refs/heads/ | awk -F'heads/' '{ print $NF }' | fzf + fi +} + +function cb() { + branch=$(_branches) + git checkout "${branch}" +} + +