/mingw32/bin/git: Argument list too long

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

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

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

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

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

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

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/

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

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

Thanks anyway for your help !

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

387 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you