/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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

648 views 0 4
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