Store git fetch output in a txt file

batch-file, git

Solution

The output is written to stderr, not to stdout. So you have to add `2>&1` to the command line.

Problem

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.

Original source