I'm trying to save the output of git clone
into a bash variable. When I do the below, I only get the first line
DIR=$(git clone repo_url >& /dev/stdout)
echo $DIR
Output:
Cloning into [repo_name]...
How can I save the entire output of git clone
?
I've tried this on Ubuntu and MacOS.
Desired output
remote: Enumerating objects: 57, done.
remote: Counting objects: 100% (57/57), done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 9163 (delta 28), reused 30 (delta 11), pack-reused 9106
Receiving objects: 100% (9163/9163), 14.62 MiB | 44.41 MiB/s, done.
Resolving deltas: 100% (7014/7014), done.