We run a custom power shell script as part of deployment process which performs git fetch from our repository. We are able to get the latest source files from our git repository successfully but octopus consider that as error since git fetch results emit messages to stderr. Hence, we tried to use “–quiet” option which suppress the messages. But, it didn’t work and still we are getting messages which triggers the error. It works in power shell console. Please refer the attachment. Any help in this highly appreciated.
script.txt (958 Bytes)
You might just need to add --quiet to your git reset command as well.
If that doesn’t work, or if you want to keep the output, you can redirect stderr to stdout. In theory you should just be able to do:
git fetch 2>&1
In practice this won’t help because PowerShell still outputs an error. What does work is sending your command through cmd and redirecting:
cmd /c git fetch 2\`>\`&1
Note the backtick escaping of
I hope that helps.
Its working fine when adding the option --quiet in git reset command. It suppresses the messages from Git and I am not getting warning in Octopus.