]> git.phdru.name Git - git-scripts.git/blob - fork
Add cloned repository to the list of repos to process
[git-scripts.git] / fork
1 #! /bin/sh
2
3 if [ -z "$2" ]; then
4    echo "Usage: $0 upstream origin" >&2
5    exit 1
6 fi
7
8 upstream="$1"
9 origin="$2"
10 local_repo="`basename \"$origin\" .git`"
11
12 git clone -o upstream "$upstream" "$local_repo" &&
13 cd "$local_repo" &&
14 pwd >> "`dirname \"$0\"`"/locate-all.list &&
15 git remote add origin "$origin" &&
16
17 chmod a-x .git/config &&
18 branch="`git branch | awk '/^\*/ {print $2}'`" &&
19
20 git pull origin $branch &&
21 git push -u origin &&
22
23 git config branch.$branch.remote upstream &&
24 git config branch.$branch.remotepush origin &&
25 git config branch.$branch.merge refs/heads/$branch &&
26 git config push.default current &&
27
28 exec git gc --aggressive