summaryrefslogtreecommitdiff
path: root/scripts/git-admin-clone
blob: cc2157ad5facd08431528ce115d8c541338bc30f (plain)
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
#!/bin/sh

set -ue

usage () {
	echo "usage: $0 URI DEST"
}

URI="$1"
DEST="$2"


test "x$URI" = "x" && { usage; exit 1; }
test "x$DEST" = "x" && { usage; exit 1; }

git init "$DEST"

cd "$DEST"

git remote add origin "$URI"

git config remote.origin.fetch '+refs/gitano/*:refs/remotes/origin/*'
git config remote.origin.push 'refs/heads/*:refs/gitano/*'

git remote update origin

git checkout -b admin origin/admin