As noted in several forums, a recommended way to move trees between
is to use git-filter-branch to revise the history for a single tree:

However, this can lead to argument list too long errors when the original
repository has many retained branches (>6k)

/usr/local/git/libexec/git-core/git-filter-branch: line 270:
/usr/local/git/libexec/git-core/git: Argument list too long
Could not get the commits

Piping the saved output from git rev-parse into git rev-list avoids this
problem, since the rev-parse output is not processed as a command line
--- | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ b/
index ac2a005..60d239b 100755
--- a/
+++ b/
@@ -255,7 +255,7 @@ else
-rev_args=$(git rev-parse --revs-only "$@")
+git rev-parse --revs-only "$@" > ../parse
 case "$filter_subdir" in
@@ -267,8 +267,9 @@ case "$filter_subdir" in
+cat ../parse | \
 git rev-list --reverse --topo-order --default HEAD \
-       --parents --simplify-merges $rev_args "$@" > ../revs ||
+       --parents --simplify-merges --stdin "$@" > ../revs ||
        die "Could not get the commits"
 commits=$(wc -l <../revs | tr -d " ")

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to