0

I try to redirect both the standard output and error of a simple Linux command as below :

git clone https://git.oschina.net/luzhao/helloworld.git  &> log

after it finish I look into the log file :

cat log
Cloning into 'helloworld'...

absolutely , the log is not completed , some output was missed somehow . The completed log should be like this :

git clone https://git.oschina.net/luzhao/helloworld.git         
Cloning into 'helloworld'...
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 18 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (18/18), done.
Checking connectivity... done.

anyone can help ? why some output were missed ? I am using Ubuntu14.04 with bash

Patrick Collins
  • 10,306
  • 5
  • 30
  • 69
Chris.Huang
  • 545
  • 1
  • 4
  • 9

1 Answers1

3

This is a weirdness of git, the output changes when it's not being sent to a terminal. Pass the --progress option to git.

Community
  • 1
  • 1
Patrick Collins
  • 10,306
  • 5
  • 30
  • 69