summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/git-clone.txt3
-rwxr-xr-xgit-clone.sh12
2 files changed, 12 insertions, 3 deletions
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index cbd83f3..fefd298 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -25,7 +25,8 @@ This is to help the typical workflow of working off of the
remote `master` branch. Every time `git pull` without argument
is run, the progress on the remote `master` branch is tracked by
copying it into the local `origin` branch, and merged into the
-branch you are currently working on.
+branch you are currently working on. Remote branches other than
+`master` are also added there to be tracked.
OPTIONS
diff --git a/git-clone.sh b/git-clone.sh
index 1adf604..4fdd652 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -202,8 +202,16 @@ then
mkdir -p .git/remotes &&
echo >.git/remotes/origin \
"URL: $repo
-Pull: $head_points_at:origin"
- cp ".git/refs/heads/$head_points_at" .git/refs/heads/origin
+Pull: $head_points_at:origin" &&
+ cp ".git/refs/heads/$head_points_at" .git/refs/heads/origin &&
+ find .git/refs/heads -type f -print |
+ while read ref
+ do
+ head=`expr "$ref" : '.git/refs/heads/\(.*\)'` &&
+ test "$head_points_at" = "$head" ||
+ test "origin" = "$head" ||
+ echo "Pull: ${head}:${head}"
+ done >>.git/remotes/origin
esac
case "$no_checkout" in