0

I've an upgrade script in a git project which causes the yarn.lock file to be updated as a result.

Now, this script is called in TFS via a build task. What I want is that after calling the script (it'd be a yarn task) I can configure the task to do an "add .", "commit -m "upgrade" and "push origin master" as a succession of steps.

Is this possible? I didn´t see any Git tasks when adding new steps, but I guess I could just use a cmd task to do it.

Thanks!

David
  • 3,364
  • 10
  • 41
  • 84
  • Is this file going to ever be modified by anyone else? I ask because then you will most likely cause merge conflicts, and if it is the TFS build script that gets that merge conflict you're not going to get a good automated process to handle it. – Lasse V. Karlsen Apr 18 '17 at 10:17
  • I see what you mean, but no, I won´t have merge conflicts in this TFS build, so that should not be a problem. – David Apr 18 '17 at 10:29

1 Answers1

0

Yes, you could use Command line task to run git command. Or you could also put your git command in a atch file and you use Batch Script step. You could even use PowerShell step to run git command.

For more detail steps, please refer to this link: https://www.visualstudio.com/en-us/docs/build/scripts/git-commands

Another similar case: Executing git commands inside a build job in Visual Studio Team Services (was VSO)

Community
  • 1
  • 1
Tingting0929
  • 4,142
  • 1
  • 14
  • 14