-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-remotes.sh
More file actions
executable file
·27 lines (21 loc) · 841 Bytes
/
setup-remotes.sh
File metadata and controls
executable file
·27 lines (21 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
set -euo pipefail
GITHUB_URL="git@github.com:tolik518/strong-api-workout-sync.git"
TANGLED_URL="git@tangled.org:tolik518.tngl.sh/strong-api-workout-sync"
# Ensure we are inside a git repo
git rev-parse --is-inside-work-tree >/dev/null
# Ensure origin exists
if ! git remote get-url origin >/dev/null 2>&1; then
git remote add origin "$GITHUB_URL"
else
# Use GitHub as the default fetch/pull source
git remote set-url origin "$GITHUB_URL"
fi
# Remove old/duplicate push URLs if present
git remote set-url --delete --push origin "$GITHUB_URL" 2>/dev/null || true
git remote set-url --delete --push origin "$TANGLED_URL" 2>/dev/null || true
# Add both push targets
git remote set-url --add --push origin "$GITHUB_URL"
git remote set-url --add --push origin "$TANGLED_URL"
echo "Configured remotes:"
git remote -v