4 echo "Usage: $0 upstream origin" >&2
10 local_repo="`basename \"$origin\" .git`"
12 if [ -d "$local_repo"/.git ]; then
17 git remote add upstream "$upstream"
18 git remote set-url origin "$origin" || git remote add origin "$origin"
20 git clone -o upstream "$upstream" "$local_repo" &&
22 chmod a-x .git/config &&
23 git remote add origin "$origin"
26 "`dirname \"$0\"`"/set-commit-date-recursive &&
27 pwd >> "`dirname \"$0\"`"/locate-all.list &&
28 branch="`git rev-parse --abbrev-ref HEAD`" &&
30 git pull upstream $branch &&
31 git pull origin $branch &&
32 git push -u origin $branch &&
34 git config branch.$branch.remote upstream &&
35 git config branch.$branch.remotepush origin &&
36 git config branch.$branch.merge refs/heads/$branch &&
37 git config push.default current &&
39 exec git gc --aggressive