Sprintstar
Sprintstar

Reputation: 8159

Add files from a git repo to TFS

I have the requirement to periodically read latest code from a git repo (BitBucket) onto my machine, then push files these into an existing TFS project. The files in BitBucket are being actively worked on, but I need add the latest version of these files into a VS project, and push them up to TFS (Cloud TFS).

As a non-Git user, i'm struggling to understand the terminology. I have found the following questions, but I don't really understand them:

Ideally I'd like to do everything though the VisualStudio 2015 IDE.

Edit

The TFS project is NOT Git based, its classic TFVC.

Upvotes: 0

Views: 1926

Answers (1)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51103

It's very easy to achieve. You must have a local git repo corresponding to a remote repo holding by BitBucket on your machine.

Then you just need to add a new remote client(TFS holding) for your local git repo. Such as using git remote add command. You should be able to push your local code to a remote repo holding by TFS server.

What you need to do is pull down the latest code from the remote BitBucket repo to your local git repo. Then push your local git repo to remote TFS repo. Follow the tutorial of second link in your question.

If you are a totally new user to GIT, suggest you take several hours to go through this link Learn Git. Moreover, Git command is very powerful. No matter what, you always need it. Combine VisualStudio 2015 IDE and Git command when you are working with GIT.


Update

  1. In VS- Team Explorer find your local repo, if there are not then add it.

    enter image description here

  2. Double click to open your local repo -settings - repository settings- add remote url

    enter image description here

Then you will be able to push your local repo to remote repo holding by TFS or VSTS.


Update 2

If you TFS project is not GIT based. You could use git-tfs is a two-way bridge between TFS (Team Foundation Server) and Git. Or more easier way- create a git repo in your TFVC project. You could hold TFVC and Git repositories in the same team project if you want to.

Upvotes: 1

Related Questions