Linked Questions
14 questions linked to/from Git clone: Redirect stderr to stdout but keep errors being written to stderr
66 votes
5 answers
47k views
$LastExitCode=0, but $?=False in PowerShell. Redirecting stderr to stdout gives NativeCommandError
Why does PowerShell show the surprising behaviour in the second example below? First, an example of sane behaviour: PS C:\> & cmd /c "echo Hello from standard error 1>&2"; echo "`$...
15 votes
4 answers
7k views
PowerShell ISE throws an error on git checkout
In PowerShell, git checkout runs without any error message. In the ISE, while git checkout stills works, the ISE gives an error message. > git checkout master Your branch is ahead of 'origin/...
9 votes
2 answers
12k views
PowerShell Capture Git Output
Problem I am running some git commands through PowerShell but I am having issues capturing the output. Many of the ways I have looked into have failed to capture any output at all until I tried ...
24 votes
1 answer
19k views
Running "Git-Clone" from Powershell giving errors even when it seems to work
How do I interpret the errors coming out of this PowerShell script that calls "Git Clone" (actually using GitLab). And can I clone an empty directory and cause it to work without getting ...
33 votes
1 answer
7k views
How to stop git from writing non-errors to stderr
I have a script that I am using to automatically sync various remote git repositories. One thing I am trying to do with my scripts is to capture the output of stderr from every command and write all ...
16 votes
2 answers
4k views
Don't throw PowerShell exception on writes to stderr from external command
When an external command, such as git, writes to stderr, PowerShell generates a NativeCommandError exception. I would like to see the output normally along with stdout similar to how it might look on ...
4 votes
3 answers
1k views
Invoke-Expression, not all output returned to variable
I'm using some GIT commands in my PowerShell scripts. Most of the time I'm calling the GIT commands via Invoke-Expression so that I, e.g. can parse the output, or/and forward the out to a logging ...
3 votes
2 answers
4k views
Assigning output of git log to powershell variable
I want to assign output of git log into a variable, output only goes to the screen and the variable is left null. $log = Push-Location $tempRepo;git init -q;git remote add origin ssh://[email protected]....
2 votes
1 answer
1k views
Git Clone generating an error in Azure Command Line Task
In my Azure DevOps CD pipeline, I have added a Command Line task which clones a Git repository. The clone is done successfully however there is an error in the log. The strange behavior is that the ...
2 votes
1 answer
2k views
Azure Pipeline: Output from commands threaded as Errors
I'm currently building a Pipeline to deploy my PHP Symfony Project from Dev Ops Repo to my Server. I use a SSH Task to execute the commands on the Server. The SSH Connection works fine, but some ...
0 votes
0 answers
432 views
how to readData from NSTask(Process)
@IBAction func startLocalAction(_ sender: NSButton) { cmd(cmdStr: ["-c","cd Desktop;ls;git clone https://github.com/Fidetro/Masonry"]) } @objc func receivedData(notification:NSNotification) { ...
2 votes
0 answers
317 views
git clone writes to stderr
When I run a git clone command using child_process.exec it outputs to stderr instead of stdout const proc = child_process.exec(bashCommand, { cwd }); proc.stdout.on("data", data => {...
1 vote
1 answer
239 views
TFS2015 Build Definition Powershell error
I have created a powershell script that is ran as the first step in my build definition that gets the latest code and tags the branch as well as execute GitVersion.exe /updateassemblyinfo. The ...
0 votes
1 answer
128 views
How to sync local changes to a SECOND Git repository?
I'm using a local TFS 2018 instance for a customer project in which he owns the source code. I want him to have complete access to this code in the event I become unexpectedly unavailable. My ...