6

I've just untargzipped some code and I want to add a whole bunch of files at once to the repository and commit. Unfortunately git add doesn't have a --quiet flag and all that I/O to print every single file from the tarball is slowing things down. How can I speed this operation up (by silencing output from git add?).

What I would like to do is:

git add . --quiet

Since this flag does not exist I've tried redirecting standard error:

git add . 2&> /dev/null

Unfortunately git strangely returns without adding any files when I do this.

How can I solve the problem?

Thanks.

John Sonderson
  • 3,238
  • 6
  • 31
  • 45
  • 6
    You could always just do `git add . > /dev/null`. – Crowman Oct 09 '14 at 12:11
  • 1
    http://stackoverflow.com/a/8944284/6309 can help too. – VonC Oct 09 '14 at 14:53
  • Thank you for posting the link to the related post which contains a lot of useful information. However I'm not sure what is going wrong. I'm using Git compiled with its version number set to 1.7.3.1.msysgit.0 inside Aptana Studio 3 build 3.6.0.201407100658. In this environment when I direct stdout and stderr to /dev/null the output is still printed, just as though I didn't redirect. Why is this happening? – John Sonderson Oct 13 '14 at 09:01

1 Answers1

3

How about simply:

git add . 1>/dev/null 2>/dev/null

You can also do things like logging the warnings/errors to one file and the output to another with:

git add . 1>git.log 2>git.err
Tripp Kinetics
  • 5,178
  • 2
  • 23
  • 37