From 01b5d75e4c92b2bcb12fbb43976b2300e9c5ed1e Mon Sep 17 00:00:00 2001 From: pfych Date: Wed, 2 Oct 2024 15:47:59 +1000 Subject: [PATCH] Script for checking out off main --- .config/scripts/tool/git.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.config/scripts/tool/git.sh b/.config/scripts/tool/git.sh index 25c2fbb..fdc9860 100644 --- a/.config/scripts/tool/git.sh +++ b/.config/scripts/tool/git.sh @@ -55,3 +55,10 @@ function restore() { git restore --staged "$(git status | grep modified: | sed -e 's/ *.*: *//g' | tac | fzf -m)" git status } + +function offMain() { + is_in_git_repo || return + git fetch origin main:main + git checkout main + git checkout -b "$1" +}