I want to store the output of this command in a text file and this was my attempt:
git fetch -v --dry-run >test.txt
All what happens is it continues to write to the console and creates an empty txt file. On a high level, I am writing a batch file to determine if there are changes to update my local copy of the repository.
The output is written to stderr, not to stdout. So you have to add 2>&1
to the command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With