Skip to main content

git: ensure I’m on my personal tailnet when pulling personal repos

ID
2f7b2f2
date
2026-05-15 12:54:19+00:00
author
Alex Chan <alexc@tailscale.com>
parent
f8a0c12
message
git: ensure I'm on my personal tailnet when pulling personal repos
changed files
2 files, 6 additions, 4 deletions

Changed files

git/gm (872) → git/gm (1023)

diff --git a/git/gm b/git/gm
index 21301a8..a5b3878 100755
--- a/git/gm
+++ b/git/gm
@@ -6,6 +6,11 @@ set -o nounset
 
 ROOT="$(git rev-parse --show-toplevel)"
 
+REPO_NAME="$(basename "$ROOT")"
+if git remote get-url origin | grep "phaenna-mac-mini" >/dev/null; then
+  ensure_on_tailnet.sh "alexwlchan.github"
+fi
+
 # Checking for the branch first is a bit slower, but avoids a potentially
 # confusing warning immediately before the pull:
 #

tailscale/ensure_on_tailnet.sh (431) → tailscale/ensure_on_tailnet.sh (372)

diff --git a/tailscale/ensure_on_tailnet.sh b/tailscale/ensure_on_tailnet.sh
index 9354ce7..6e2b5c2 100755
--- a/tailscale/ensure_on_tailnet.sh
+++ b/tailscale/ensure_on_tailnet.sh
@@ -8,14 +8,11 @@ if (( $# == 0 )); then
   exit 1
 fi
 
-if [[ $(hostname) != "Alexs-MacBook-Pro.local" ]]; then
-  exit 0
-fi
-
 target_tailnet="$1"
 current_tailnet="$(tailscale status --json | jq -r .CurrentTailnet.Name)"
 
 if [[ "$current_tailnet" != "$target_tailnet" ]]; then
   print_info "-> tailscale switch '$target_tailnet'"
   tailscale switch "$target_tailnet"
+  echo ""
 fi