I am trying
git status *> test.txt
This works in powershell well but if I do this using python –
os.system('git status'+' *> '+log_path+'git_output.txt')
fatal: ‘*’ does not appear to be a git repository fatal: Could not read from remote repository.
os.system('git status'+' 2> '+log_path+'git_output.txt')
Btw, this worked! But I want all kinds of output in the file!
What is the best way to do this?
Advertisement
Answer
Have a look at redirection from command prompt (different from powershell)
os.system('git status'+' 1> '+log_path+'git_output.txt 2>&1')