From 8a679661c2a418bb85953b234c4ca7b7f7e07d19 Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 22 Jan 2021 17:28:58 +0000 Subject: [PATCH] Updated pullall function --- .bash_aliases | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index 285cc2f..afb305d 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -73,7 +73,11 @@ function pullall() { cd "$dir" || exit 1 # If it's a git directory, then update it if test -d .git; then + if [ "$(grep -c "[branch "master"]" .git/config )" -gt 0 ]; then echo "$dir is a Git repo. Pulling master branch..." && git checkout master && git pull && echo "" + elif [ "$(grep -c "[branch "main"]" .git/config )" -gt 0 ]; then + echo "$dir is a Git repo. Pulling main branch..." && git checkout main && git pull && echo "" + fi else echo "$dir is not a Git repo." && echo "" fi