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