I wanted to write the output of git clone to a file using
git clone https://github.com/someRepository > git_clone.file
But instead I get the output displayed/updated in the terminal like
Cloning to 'someRepository' ...
remote: Counting objects: 2618, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 2618 (delta 2), reused 12 (delta 1), pack-reused 2603
Received objects: 100% (2618/2618), 258.95 MiB | 4.39 MiB/s, Done.
Resolving Differences auf: 100% (1058/1058), Done.
Check Connectivity ... Done.
But the file git_clone.file is generated but remains empty.
My original goal was to bypass the output of git into a function (see my question here). But now I realized git doesn't even seem to produce the output to stdout really but somehow different since nothing is written to the file.
How can I get this displayed output from git in order to redirect it to a file/function?
EDIT
The proposed redirection of stderr (and stdout) did not solve the problem.
git clone https://github.com/someRepository 2> git_clone.file
git clone https://github.com/someRepository &> git_clone.file
git clone https://github.com/someRepository > git_clone.file > 2>&1
all gave me the same result: only the line
Cloning to 'someRepository' ...
appears in git_clone.file
BACKGROUND INFORMATION
Why do I need this?
As explained in my other question here I wrote a custom progress bar always at the bottom of the output my scripts. (I use it in multible scripts but) The script in this case migrates a lot of (until now 107) git repositories from github to our own Gitlab-Server and repairs the Git LFS support which usually is lost without it.
So I would like to still see all the output of git but also would like to have my progress bar working at the bottom of the output in the terminal.
git clone https://github.com/someRepository > git_clone.file 2>&1? – ridgy Dec 23 '17 at 20:15>file 2>&1equals&>filein modernbash, in case someone wonders. – dessert Dec 23 '17 at 20:36