I'm seeing some strange behavior from TFS and I'm trying to understand what it is telling me.
I have two branches, $/Project/trunk and $/Project/master (trunk is branched from master)
A merge was done this way, merging everything from trunk to master.
tf merge $/Project/trunk $/Project/master /recursive
Example tf history $/Project/trunk /recursive
12 Dev C 10/1/2015 message
11 Dev B 10/1/2015 message
10 Dev A 9/30/2015 message
Yet, tf merges $/Project/trunk $/Project/master /recursive shows
Changeset Merged in Changeset Author Date
--------- ------------------- -------------------------------- ----------
10 526 Dev A 10/15/2015
12 526 Dev A 10/15/2015
So what happened to changeset 11 ???
- It was clearly merged (tf merge /candidate does not show it).
- It is clearly in the history of trunk
Yet it does not show as merged in the merge tracking? Why?
BTW: I'm using TFS 2013, with tf.exe from Visual Studio 2015
Clear the TFS Client cache (The cache folder locate in C:\Documents and Settings[USER]\Local Settings\Application Data\Microsoft\Team Foundation\4.0\Cache on your development machine), and then double check if changeset 11 still exist in trunk. By the way, what is the version of the TFS you are using?
Related
In a private repo I created a PR to merge changes from dev into master. The PR shows 168 to be merged automatically - I proceeded with merge and all was ok.
I then created another PR to merge changes from dev to master - I expected 0 files as I had just merged, however it showed the same 168 files, curious I proceeded with the merge and when I looked at the commit, it showed 0 files
This wasn't across a fork - just 2 branches in the same repo - can anyone explain why the PR showed 168 files - was this a caching issue?
The difference between the number of files to be merged and actually merged (0) does indeed point out to a cache issue on the remote side.
I would test the caching issue by making the second PR a day after the first, and checking that 0 (or only a few file if you have pushed new commits on dev) show up.
If the PR does a three-dots comparison (using the base commit), not that since Sept. 2018, you can also do, from GitHub, a two-dots comparison.
See more with:
"What are the differences between double-dot “..” and triple-dot “...” in Git?"
"What are the differences between double-dot “..” and triple-dot “...” in Git commit ranges?"
Using tfs2015 (not git but tfvc)
We have a MAIN branch and I created my development branch from MAIN branch.
__MAIN (branch)
|__MYDEV (my new branch)
After a while, my friends pushed 2 new changesets to MAIN.
__MAIN [change1], [change2]
|__MYDEV [mychange1]
Question: How can I get those 2 changesets onto MYDEV branch as 2 changesets as they are by merging (rebasing) my change on their changes?
If I try merging MAIN onto MYDEV, 2 changesets are coming as pending changes of bunch of files, but I want them as they are as packaged in 2 changesets and put my changes on them.
Finally what I expect,
__MAIN [change1], [change2]
|__MYDEV [change1], [change2], [mychange1-with-merge-fixes]
If you use git-tfs it will give you all the powers of git, highly recommended. Now, visual studio will maybe be a little bit upset when it detects a .git directory, but you can avoid that by setting GIT_DIR and GIT_WORK_TREE environmental variables (see this answer for details).
You can use "Rebase" tool to keep every merged changeset separately in the branch.
To use rebase tool in TFS, follow the steps below if you have Team Explorer installed:
Launch Team Explorer and connect to your project.
Open "Branches".
Checkout the branch (MYDEV) you'd like to rebase.
Right click the branch and select "Rebase Onto..." option.
Select the Onto Branch (MAIN) and then click "Rebase" button. (Resolve the conflict and click "Continue" button if there is any conflict during the rebasing)
Introduction about TFS Rebase: https://msdn.microsoft.com/en-us/Library/vs/alm/Code/git/rebase
I'm getting a very unhelpful message when I try to pull from git in team explorer:
I have nothing left to commit locally:
I could use some tips on where to start looking with this one, e.g. how to even find out what the two conflicts are (the error isn't clickable to drill or anything).
I have some untracked changes, but they are just package files such as the Entity Framework 6.1
Edit: git status:
On branch dev
Your branch and 'origin/dev' have diverged,
and have 2 and 16 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
When trying to git pull, it references files that are not showing up anywhere in vis studio team explorer to commit:
error: Your local changes to the following files would be overwritten by merge:
packages/Modernizr.2.6.2/Content/Scripts/modernizr-2.6.2.js
packages/Respond.1.2.0/content/Scripts/respond.js
packages/Respond.1.2.0/content/Scripts/respond.min.js
packages/bootstrap.3.0.0/content/Content/bootstrap.css
packages/bootstrap.3.0.0/content/Content/bootstrap.min.css
packages/bootstrap.3.0.0/content/Scripts/bootstrap.js
packages/bootstrap.3.0.0/content/Scripts/bootstrap.min.js
packages/jQuery.1.10.2/Content/Scripts/jquery-1.10.2.js
packages/jQuery.1.10.2/Content/Scripts/jquery-1.10.2.min.js
packages/jQuery.Validation.1.11.1/Content/Scripts/jquery.validate.js
packages/jQuery.Validation.1.11.1/Content/Scripts/jquery.validate.min.js
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
Web/Web.config
packages/elmah.corelibrary.1.2.2/elmah.corelibrary.1.2.2.nupkg
packages/elmah.corelibrary.1.2.2/lib/Elmah.dll
Please move or remove them before you can merge.
Aborting
Stash by running git stash, then do a git pull
From what I have read, when merging SVN before 1.4 I have to do this "by hand" because the previous-merge info is not available:
svn merge svn://server/repo/trunk#revision svn://server/repoo/branch .
Since this is the first time I am merging what do I put in revision? Do I use the one at "branch time"?
Also, is there any way of doing this within the Eclipse-Collabnet client or do I have to do it via Tortoise?
The command to use is explained in the SVN book. Assuming you started your maintenance branch at revision 341, and the trunk is at revision 405, and the working copy is pointing to the trunk, the command should be:
svn merge -r 341:405 http://svn.example.com/repos/calc/branches/my-maintenance-branch
Remember that a merge consists in applying a diff from point A to point B into the working copy. Here, points A and points C are in the same branch: the maintenance branch: all the changes you made in this branch must be reapplied on the trunk.
As with most things in TFS you get more than you bargained for. In this case I am seeing more file changes during the merge than I was expecting.
I have 2 child branches, lets be exciting and call them branch1 and branch2. Both have changes made to them since they were created. I need to take 12 specific changesets from branch2 and merge them into branch1. The changes from branch2 can not go back to the parent branch. So it's a straightforward case for a baseless merge, but the results are not what I expected.
Taking the first changeset I ran the following command:
tf merge /baseless /recursive /version:C95654 branch2 branch1
Changeset 95654 contains 12 changed files but after this command I get 56 edited files with conflicts. I was expecting to only merge the specified changeset from one branch to the other but it appears to have merged the entire folder.
So why do I get 56 files changed rather than 12 when I specified the changeset? Also what can I do to restrict what is merged to only the contents of that changeset?
If you need to merge a specific changeset you need to use the following statement:
tf merge /baseless /recursive /version:C95654~C95654 branch2 branch1
(It means ONLY changeset C95654).
The commandline you are using means every changeset before and with C95654.
I had to use tfs paths for the two branches. Steps were: add both branches to the desired workspace; get latest; open a Windows powershell in the target folder. Get tfs paths
>tf workspaces /format:detailed
>tf workfold
Then use $paths for the branches. Same changeset number between the tilde ment baseless merge for one changeset.
>tf merge /baseless /recursive /version:C999~C999 "$/MyRepo/Current" "$/MyRepo/Development"
More here --
http://blogs.msdn.com/b/bharry/archive/2011/08/31/merge-enhancements-in-tfs-11.aspx