Gnanz
Gnanz

Reputation: 1873

Hiding response from remote tfs-git during GIT Push to TFS-GIT

I'm trying to sync files present in git-hub repository(used by remote team) to local git repository in TFS.

For this purpose i'm using following commands:

REM Public GIT repository
git remote set-url  origin https://github.com/<user>/<Project>.git
REM Private GIT repository
git remote set-url targettfs  http://LocalServer:8080/tfs/DefaultCollection/_git/<ProjectName>

REM Pull updates from GITHUB
git reset --hard HEAD  
git fetch origin --quiet
git pull origin master --quiet

REM Sync TFS-GIT to local
git init
git reset --hard HEAD  
git fetch targettfs --quiet
git pull targettfs master --quiet
git add .
git commit -m "sync file with github" --quiet

REM Push updates to GIT repository in TFS
git push origin master  --quiet

This script doing major task as expected, Problem here is when doing this i'm getting some response is written back in console like below:

GIT push feedback message

For this i tried --quiet with TFS push, but no use

Upvotes: 1

Views: 222

Answers (1)

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31083

According to your screenshot, TFS Build treats git output as errors. Please check the answer in this case:

Git outputs its content to the error stream which Visual Studio Team Services interprets as error.

You need to redirect Gits output in your script like this to make it working:

git pull 2>&1 | Write-Host

Upvotes: 1

Related Questions