TFS merge discarded still shown in merge wizard (vsts) - tfs

I have a TFS build that generates some static resources and checkin the changes into DEV.
Then, when merging from DEV to QA, the "static resources" changeset will be shown. But I don't wan't to merge these changeset because in each branch are generated.
I found "tf merge" and following the documentation at the end of the build I execute a script like:
tf merge $/DEV/Product/source_branch/static/
$/DEV/Product/target_branch/ /discard /recursive
After that I tried to do a checkin, but there are no pending changes (as I'm discarding all). Don't do a checkin, but then in the merge wizard on Visual Studio I can see the changeset from DEV.
What I'm doing wrong? I want to don't see the discarded changesets when I merge form DEV to QA in Visual Studio

Related

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.

Why does tf merge /candidate doesn't show pending merges while Visual Studio does?

When I list my pending merges between Branch1 and Branch2 on Visual Studio it shows them. But If I use tf it doesn't.
The command I am using to list my pending merges with TF is:
tf merge /candidate Branch1 Branch2
And I get
There are no changes to merge.
Why is TF showing no pending merges?
I am using Visual Studio 2013 with TFS 2013.
You need to add the /recursive flag, otherwise tf merge will only compare the folders and will not check the child elements.
Of course you need to be in the workspace at the right location, to run the command.

Can you merge two branches in Visual Studio Online?

At the moment, from what I know, if you have two branches, you have to have both branches mapped to locations on your machine and Visual Studio (or TFS within Visual Studio) will download the latest version and merge the changes locally and then you have to check in the other branch. I would like to be able to merge this branch with this branch with only having one branch mapped locally?
The purpose of this is that we have a development branch, a test branch and a release branch and we are merging changes from the development branch into the test branch and building it on the server which is then deploying it on another server. All this is working great but the test (and release) branch must be mapped on the machine of anyone trying to do this otherwise it won't work.
Ideally I'd like to be able to log into Visual Studio Online and do all the merges, builds and deployments there rather than on my development machine at all - is any of this possible? And if so, how please?
Not entirely sure this is something support-able by the TFS product, actually. Merges tend to need at least a minimal amount of human interaction whenever there is conflicts (and even in the cleanest merge relationships conflicts can and do arise).
However, you can do this on the build machines if you wish by performing the merge just before the build occurs and if the build succeeds, checking the merged changeset in.
Using the Pre- and Post- build script functionality in TFS build, you could try to do something such as the following...
Pre-build script would include commands such as:
tf merge $/ProjectRoot/Branches/Dev $/ProjectRoot/Branches/Test
tf resolve $/ProjectRoot/Branches/Test /r /i /auto:TakeTheirs
Post-build script would include:
tf checkin $/ProjectRoot/Branches/Test /r /i /comment:"***NO_CI*** [AutoMerge]"

Create TFS 2010 branch from checked out items?

I've edited some files in Branch1 and found out I would like to check the pending changes in to a new branch, Branch2. Is this possible?
I know I can create the branch as normally and then copy all the changed files to Branch2 by hand but that can be cumbersome.
You can shelve your changes and the unshelve them into another branch: Can I unshelve to a different branch in tfs 2008?

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

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.

Resources