git add -h > temp.txt && output captured in file temp.txt git add > temp.txt && output NOT captured in file temp.txt git branch -h > temp.txt && output NOT captured in file temp.txt git branch > temp.txt && output captured in file temp.txtSearching on the internet I found out that commands have at least two different output streams, STDOUT and STDERR
git add > temp.txt 2>&1 && output IS captured in file temp.txt because command output is an error message in STDERRHowever, in the case of "git branch -h", GIT sends its output to STDERR, even though it should go to STDOUT !
git branch -h > temp.txt 2>&1 && output IS captured in file temp.txtAlex