How do I perform a git-tfs pull command from the first task in a Bamboo build plan?

A signifcant proportion of our .Net source code is being checked in to TFS. For a number of reasons we have been investigating a migration to git as the TFS source code repository for some of our .Net solutions.

We have proceeded cautiously and have created a few git repositories that simply 'mirror' a selection of TFS repositories in order to avoid any side-effects in TFS. Code is still being checked-in to TFS via the VS IDE but there is currently no automatic way to keep the git repositories in synch with their TFS sisters.

We need to somehow automate a git-tfs pull command on each repository to retrieve any recent changes prior to each new build in Bamboo. How can this be achieved from within a task in a Bamboo build plan?

2 answers

1 accepted

Thank you Timothy - however SSH is not really necessary as we have a small intranet, and both servers are on tyhe same network.

I neglected to add in my initial question that git is running on Windows 2008 Server.

In the end I found that what is needed is to execute a bash script from a Windows .cmd file. Cygwin was already installed on the server and all that was necessary in the end was to iniatalise a bash shell from the .cmd file passing the location of the bash script (which actually executes git-tfs pull).

The trickiest part was persuading the bash shell to run the script from within the git repository.

0 vote
Timothy Chin Community Champion Apr 29, 2014

Use a SSH task to pull from TSF to Git (https://gist.github.com/jschementi/286677). Then execute your remaining tasks.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Keough
Published yesterday in Training & Certification

The Project Administration in Jira Server Certification is here!

The Atlassian Certification you've been waiting for is here for good. We're thrilled to announce the official launch of our new Certification for Project Administration in Jira Server! The offering ...

71 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you