Skip to content

Commit 36702f9

Browse files
committed
added set up remotes script
1 parent 9300e3e commit 36702f9

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

setup-remotes.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
GITHUB_URL="git@github.com:tolik518/strong-api-workout-sync.git"
5+
TANGLED_URL="git@tangled.org:tolik518.tngl.sh/strong-api-workout-sync"
6+
7+
# Ensure we are inside a git repo
8+
git rev-parse --is-inside-work-tree >/dev/null
9+
10+
# Ensure origin exists
11+
if ! git remote get-url origin >/dev/null 2>&1; then
12+
git remote add origin "$GITHUB_URL"
13+
else
14+
# Use GitHub as the default fetch/pull source
15+
git remote set-url origin "$GITHUB_URL"
16+
fi
17+
18+
# Remove old/duplicate push URLs if present
19+
git remote set-url --delete --push origin "$GITHUB_URL" 2>/dev/null || true
20+
git remote set-url --delete --push origin "$TANGLED_URL" 2>/dev/null || true
21+
22+
# Add both push targets
23+
git remote set-url --add --push origin "$GITHUB_URL"
24+
git remote set-url --add --push origin "$TANGLED_URL"
25+
26+
echo "Configured remotes:"
27+
git remote -v

0 commit comments

Comments
 (0)