/mingw32/bin/git: Argument list too long

thvig April 15, 2016

I have the following error:

/mingw32/bin/git: Argument list too long

when i do :

git archive -o ../archive.zip HEAD $(git diff --name-only --diff-filter=ACMRTUXB xxxxxxx)

xxxxxxx = SHA commit

Before it worked.

I use Git Bash Sourcetree.

Thank you for your help


1 answer

1 accepted

0 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2016

You git diff is producing a file list that has too many files for bash to allow as arguments. You might research how to use xargs to accomplish your task.

Basic usage outlined here: http://stackoverflow.com/questions/11289551/argument-list-too-long-error-for-rm-cp-mv-commands

thvig April 15, 2016

Ok, I understand the problem.

But I do not see how to solve using Git Bash SourceTree.
We must create a script?

EDIT : windows 7 os

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2016

To clarify, is SourceTree running the archive command, or are you running it by hand in the Terminal?

thvig April 15, 2016

I use the onboard terminal Source Tree (Not the archive click command).
Thank you for your help

thvig April 15, 2016

I want to create a "patch" between two commit
This is not possible directly   since the software SourceTree

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2016

Ok, then SourceTree has nothing to do with your question, it is just a generic git question.

I would recommended emailing the original author of your command and asking if he has any ideas: http://tosbourn.com/using-git-to-create-an-archive-of-changed-files/

thvig April 17, 2016

Do you know how can I simply increase the value MAX_ARGS ?

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2016

Nope, that would be a MinGW question. I'm pretty good at SourceTree, but haven't done anything under the hood of MinGW.

thvig April 19, 2016

Thanks anyway for your help !

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events