git/gm
2# Switch to my main branch and pull any changes from the remote.
7ROOT="$(git rev-parse --show-toplevel
)"
9REPO_NAME="$(basename
"$ROOT")"
10if git remote get-url origin
| grep
"phaenna-mac-mini" >/dev/null
; then
11 ensure_on_tailnet.sh
"alexwlchan.github"
14# Checking for the branch first is a bit slower, but avoids a potentially
15# confusing warning immediately before the pull:
18# Your branch is up to date with 'origin/main'.
20# The `--quiet` flag is to avoid a warning like:
22# Your branch is behind 'origin/main' by 6 commits, and can be
25# because I know I'm about to do that.
26if [[ $(gcb
) !
= $(_get_primary_branch
) ]]
28 print_info
"-> git checkout $(_get_primary_branch
) (was on $(gcb
))"
29 git checkout
"$(_get_primary_branch
)" --quiet
33# This avoids any clashes with other programs called "gp", e.g. at one
34# point I had gitpython in my PATH