After making changes in one TFS branch, how do I update other branches? - tfs

i have a branch in TFS from my main team project. The changes that have been done on the branch, I want those files to be updated in my main Team project. How do i do that?

From a Visual Studio 2008 command line, you can use the tf merge command. From the Source Control explorer, you can use the Merge Wizard.

Related

remove git repository binding from visual studio 2015

Initially my project was mapped to a git repository.I Want to remove git mapping and bind it to tfs (vs2015).I removed .git folder and its related files from the solution(my local drive) and open the solution in vs2015 and change the source control option to tfs. when adding solution to the source control I'm getting the following error
"the current solution has projects that are located outside the solution folder.These projects will not be source controlled in git repository.To add all the projects to a single git repository please consider all projects under a single folder"
If I click on OK on this error dialog, it automatically adding git folder to the solution.
I removed source controler provider for GIT from the registry via regedit. Now when i try to add solution to the tfs I am getting the error "The project or solution you opened requires a source control plug-in that is unavailable at this time.
I've tried different ways nothing worked.
Create a new team project on the TFS web portal.
Start Visual Studio session. Select Tools->Options->Plug-in Selection and switch current source control plug-in to "Visual Studio Team Foundation Server".
From Visual Studio connect to the TFS and select the collection and the newly created team project. A local folder will be created for your new team project.
Copy all your sources in the local folder of the new team project.
Open the solution in the current session of Visual Studio. Add the solution node to the source control. Check in and your done.
You cannot change or mix TFVC with Git in the same project. You need to create a TFVC project, then check in the sources to the new project.
If you don't need to keep the source history, just pull down and check into the new version control as Mircea mentioned above.
If you want to keep the history, just try to migrate all history of main branch from local repo to a new TFVC team project with following steps:
Create an empty TFVC team project
Go to your local Repo folder, and use git-tf checkin --deep command
to checkin the local repo to a TFVC team project. By default, the
checkin command will create a single TFS changeset for the aggregate
of all changes made on the current branch in Git since the last
checkin to TFS. When used with the --deep option, a TFS changeset
will be created for each Git commit on the current branch since the
last checkin to TFS.

tfpt.exe on Visual Studio 2017

Even after installing Productivity Power Tools extension for Visual Studio 2017 I still cannot run tfpt.exe to execute the command suggested on this post:
C:\Development> tfpt unshelve "ShevesetName;UserName" /migrate /source:"$/Project/Source" /target:"$/Project/Target"
Where can I find this program?
The Productivity Power Tools are not the same thing as the TFS Power Tools, so that's why installing it didn't help.
There is no set of TFS 2017 Power Tools. From the TFS 2017 release notes:
Issue: No Power Tools have been released for TFS 2017.
Workaround: We are excited to let you know that most of the previous
Power Tools have been integrated into TFS 2017. The Process Template
Editor is one that has not been integrated, but we are going to
publish a Process Template Editor tool for TFS 2017 to the Visual
Studio Gallery shortly after TFS 2017 is available. We will provide
the link here as soon as it’s published
Just as Daniel said, they are two entirely different things. A supplement :TFS 2017 Process Template Editor is available
In your case, you are trying to use the unshelve command to unshelve a shelveset to another branch in TFS. As a workaround you could use tf Unshelve and Rename command to achieve this in two steps.
Or just install a earlier version VS and Power Tools such as VS2015 and Microsoft Visual Studio Team Foundation Server 2015 Power Tools. After all you just need to match the version of the TFS Power Tools with your Visual Studio client.
Possible workaround, which helped me!
Create a new workspace and do not download all the files.
Unshelve your changes to this new workspace, which would result in having only the modified files from your current branch.
Compare and manually merge your changes into the other branch.
You can use this VisualStudio extension witch does exacly what you want:
MultiMerge - https://marketplace.visualstudio.com/items?itemName=Jesusfan.MultiMerge2022
This extension allow you to unshelve to other branch.
You can use git-tfs to accomplish this. The steps you should perform are (after git and git-tfs have been installed):
create a git branch from the shelveset (git_branch_a).
initialize a git branch (git_branch_b) based on the TFS target branch (tfs_branch_b).
merge the git_branch_a into git_branch_b.
based on the git_branch_b create a shelveset.
the new shelveset can now be unshelved in the tfs_branch_b.

Using Xcode with TFS 2015 on-premises

Is there any way to check in code from Xcode to TFS 2015 on-premises installation? Even if TFS is just acting as a go between for Xcode and Git? The main thing we'd like to be able to do is for iOS code to be checked in to TFS with changesets recorded, and work items/bugs available.
Any suggestions? We are not looking to move to VS Team Services / VS Online.
you have 2 options.
The best option is to create a new TFS Team Project with Git for source control. Or you can add a Git repo so an existing Team Project. This is a standard Git repo, but hosted in TFS. It works just like any other hosted Git repo. Clone the repo and off you go.
If you cannot use Git inside TFS and you must use TFVC then you can use git-tf. This is effectively a bridge between a local git repo and a centralized TFS TFVC repo. This article should get you started
Both VSTS and TFS 2015 include full support for Git-based source control projects. You can follow MSDN article Share your code in Git using Xcode to push your project to TFS.
After pushing your project to TFS, you'll have full history and work item available:

Visual Studio 2015 - Check in to a different branch in TFS

I checked out some files from the main branch of our code set in TFS. Later, a separate branch was created. I would like to check in my code to the new branch, even though I originally checked it out of the original one. Is this possible?
EDIT: I know I can check in to the main branch and do a merge, but I'd like to avoid that if possible.
Well, it's based on which version control you are using.
If you are using GIT, it's simple. After you created the new branch in the UI, you just need to do a 'check out' of the new branch. Any uncommitted changes will be automatically point to the new branch. You can then commit them there.
If you are using TFVC, you need to shelve your changes on the original branch and unshelve them on the other branch. This functionality is provided using tfpt unshelve /migrate command. More detail steps please refer the question: TFS: submit changes done locally in one branch to another branch
It's also a sample which shows the difference between GIT and TFVC.
Install TFS 2015 Power Tools
Create a shelveset of your changes
Open the Developer Command Prompt
Use the tfpt unshelve /migrate command as such
tfpt unshelve /migrate /source:$/Project/Branch1 /target:$/Project/Branch2
I couldn't do with the answers using Power Tools, so I checked in on the source branch, merged to target, and rolled back from source branch.

tfpt migrate for TFS doesn't do anything

I'm trying to use tfpt to migrate a shelveset from a source branch into a target branch, but it doesn't appear to do anything...not that I'd expect much more...but any chance anyone knows what's wrong? I'm following the instructions correctly I think...
I've got:
tfpt unshelve "DbMigrations" /migrate /source:$/TeamProject/Main /target:$/TeamProject/Releases/7.20
What happens after you run the command? You need to have a few things set up before migrating:
A workspace that encompasses both the source and target branches.
You need to run the command in a folder within the source.
Once you run the command you should be asked to merge the changes from the original shelfset into the destination branch and resolve any conflicts, which finally pends a changeset on your client. Nothing is touched on the server until you check that changeset into TFS itself.
I experienced the same problem and I could not get it to work by specifying the shelveset name. However, I discovered that if you remove the name of the shelveset altogether, TFS will pop up a window with a selection list of available shelvesets to choose from. Select the desired shelveset and perform all other merge operations as per normal.
Example: c:[mapped workspace target path] > tfpt unshelve /migrate /source:"$/Sourcepath" /target:"$/targetpath"
You need to use the branch paths on the TFS server, not your local machine. To find the paths, go to source control explorer in visual studio, right click the branch, advanced > properties, and you want the branch name, not the local path. If the path has spaces, wrap it in double quotes.

Resources