4 echo "Usage: $0 upstream origin" >&2
10 local_repo="`basename \"$origin\" .git`"
12 if [ -d "$local_repo"/.git ]; then
14 git remote add upstream "$upstream" &&
15 git remote set-url origin "$origin"
17 git clone -o upstream "$upstream" "$local_repo" &&
19 git remote add origin "$origin"
22 pwd >> "`dirname \"$0\"`"/locate-all.list &&
24 chmod a-x .git/config &&
25 branch="`git rev-parse --abbrev-ref HEAD`"
27 git pull upstream $branch &&
28 git pull origin $branch &&
29 git push -u origin $branch &&
31 git config branch.$branch.remote upstream &&
32 git config branch.$branch.remotepush origin &&
33 git config branch.$branch.merge refs/heads/$branch &&
34 git config push.default current &&
36 exec git gc --aggressive