diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-05-14 09:44:24 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-05-14 09:44:24 +0200 |
| commit | 49d7c2e706c41c21b16b1b41521cd9288dc28d52 (patch) | |
| tree | 836d22f7ee5278ed3e2341211039eb84abe30545 /scripts | |
| parent | 37c0762a51d6ef2c2d859d779839aeb5257a8d7d (diff) | |
| download | config-49d7c2e706c41c21b16b1b41521cd9288dc28d52.tar.gz config-49d7c2e706c41c21b16b1b41521cd9288dc28d52.zip | |
Added git clone script
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/git-clone-my | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/git-clone-my b/scripts/git-clone-my new file mode 100755 index 0000000..86238cd --- /dev/null +++ b/scripts/git-clone-my | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Clone one of my git repositories and setup multiple remote | ||
| 4 | # Usage: git-clone-my REPO | ||
| 5 | |||
| 6 | pull_remote="git@tronto.net:" | ||
| 7 | push="git@tronto.net git@github.com:sebastianotronto/" | ||
| 8 | |||
| 9 | if [ -z "$1" ]; then | ||
| 10 | echo "git-clone-my: please specify a valid repository" | ||
| 11 | fi | ||
| 12 | |||
| 13 | git clone "$pull_remote"$1.git || exit 1 | ||
| 14 | cd $1 | ||
| 15 | for repo in $push; do | ||
| 16 | git remote set-url --push --add origin "$repo"$1.git | ||
| 17 | done | ||
