We have two solutions which share same code base.
Although it is "bad practice" and they should be referencing to the same base, they are not.
I've added a new feature to the base of one solution, now I want to take the changeset and apply it to another solution.
They are both under the same team project (but diffrent solutions).
What I am doing now is using external program to compare between the two solutions and going applying the changes manualy one by one.
Maybe there is a better solution in VS2015?
You can use branches to accomplish the goal. How to branch folders and files
Since a codebase that is forked into various branches. After you added a new feature in one branch, you can directly merge the changeset to another branch. How to Merge folders and files
Finally, you can also compare folders and files to make sure all changes sync up.
Related
I am looking for some ideas and suggestions on how to implement a class hierarchy type of structure of VS projects in TFS.
Specifically, I want to have a "base" project which will contain all the common functionality the rest of the projects will inherit. When the changes are needed in the "base" project it should be relatively easy to propagate these changes to the rest of the projects which are based on this "base" project.
The obvious approach is to branch other projects from this "base" project and merge up the tree from this root project when there are changes but I've never tried that before and would like to hear from someone who attempted something like this before or has extensive enough experience with TFS to be able to point to inherent issues or pitfalls of such idea...
The projects in source control is actually folders. So your question is somehow the same as how to structure your folders in TFS.
Your base project is the some concept of main in branch which is root folder that acts as a container folder for your main source tree, together with accompanying project artifacts such as design documentation, scripts, and test cases. The Main folder also usually contains your Visual Studio Solution (.sln) files.
In TFS you could convert a folder to a branch.Then you just need to branch your base project to other projects. After have a branching relationship, you will be able to merge changes between the 2 branches. Besides you could also use branches to accomplish the following goals:
Manage concurrent work by multiple teams on the same codebase
Isolate risks that are introduced by different sets of changes to the codebase
Take snapshots and then support subsequent isolated changes (for example, to create a release branch)
Although you can still branch and merge among folders, the best practice for your team is to branch and merge only among branches.
When you perform branch operations, branches have important advantages over folders. Branches support version control features that provide extra visibility into your branch structure and into where your changesets have merged. (For more information, see these wonderful links: Visual Studio TFS Branching Guide)
For inherent issues or pitfalls of such idea, one thing is you might have to resolve conflicts when you get, check in, merge, or unshelve. Another thing is permission. It's better to avoid everyone have permission to merge changes from the “derived” projects back to the "base" project.
Besides you can create multiple teams in the same Team Project and you can nest them to facilitate hierarchy. If you are interested, you could check this blog which shows how to configure that.
We have very large project and we have to branch some of the sources. Branched sources should be stored in a different location (within the same TFS server).
The problem is that due to active development of the main project we have to merge changes from trunk every day.
So the question is: how should I branch sources to provide the easiest merging from trunk.
The desired scenario is:
pull changes from trunk. Resolve conflicts and merge changed sources.
push merged changes to branch (that is stored in different location - not as a branched version in the same location)
Is this possible without any complex scripts?
I am using Visual Studio 2013 for work with TFS source control.
You can have branch relationships been different locations in TFVC. You can branch from one team project to another and maintain the relationship.
If you currently have two locations that do not have a branch relationship you need to create one by doing a baseless merge first. One you have some a baseless merge you can then merge s normal As if they are in the same team project.
I would however recommend that you fix the problem that has lead to this situation. If you are going a single product then you should all be in the same team project.
http://nakedalm.com/one-team-project/
Lets say I have the following branches for my application in TFS2012.
May2013 and June2013.
For deploying these applications I am using TWO different build definitions. One that points to the May20123.sln and one June2013.sln. The builds are doing the exact same thing, only difference pointing to different source code.
I would like to only have one build definition which starts with popup where I can choose which branch to deploy. Is this possible?
(This is just a simple example, the actual scenario is much more complex). I am aware that could change branching strategy...
Thanks!
I do not believe this is possible out of the box, but the Clone build definition feature if TFS 2012 should make your life a lot easier. Simply, create a new branch and then clone an existing build.
I have been investigating any potential issues encountered when merging branches in TFS 2010.
All combinations which I have tried have worked perfectly, apart from one, and I am hoping that someone can help me understand why it is not working and/or what I am doing incorrectly.
It is perfectly reproducible, and I have described how below.
The problem scenario
The environment:
There is one C# Library project in both branches, called MyProject.
There are two classes in each project, called MyClass and MyOtherClass.
Branch A is the parent branch, and Branch B has been created from it.
The scenario:
MyClass.cs is edited in Branch A and renamed to MyClassRenamed.cs.
MyClass.cs is edited with a conflicting change in Branch B, but retains its name.
The outcome:
Merging the changes produces one conflict.
The conflict cannot be Auto Merged, and it only indicates issues with the content of the file, not the name change.
Fixing the conflict leaves you with files named differently in both environments, despite what name the file has when resolving the conflict.
The correct scenario
Interestingly, the behaviour is different if the scenario is inversed, see below.
MyClass.cs is edited with a conflicting change in Branch A, but retains its name.
MyClass.cs is edited in Branch B and renamed to MyClassRenamed.cs.
The outcome:
Merging produces TWO conflicts.
One conflict is the project file, and the other being the file which has renamed.
The conflict for the renamed file cannot be Auto Merged, but it notifies that the name has changed and asks for the new name for the merged file.
You can then merge the changes for that file.
You can then merge the changes for the project file.
Fixing the conflict leaves you with files named differently in both environments, despite what name the file has when resolving the conflict.
Everything works as expected, and the file is renamed in both environments and the changes kept in sync.
Conclusion
As far as I can see, the only solution is to avoid renaming files and to fix the issue manually after a merge, something I am hesitant to do if there is an automated way I can do this.
Let me a bit extend your scenario.
MyClass.cs is edited in Branch A and renamed to MyClassRenamed.cs.
MyClass.cs is edited with a conflicting change in Branch B, but retains its name.
One of these Branches had to be merged into Integration branch (let's say Branch A)
At this moment of time, team working on Branch B decided to merge changes into Integration branch. As a good practice, before merging into Integration, they should pull down the changes from Integration and merge into branch B. Only after they do that and fix conflicts, they would merge branch B into Integration.
Next time Branch A to be merge, they should also follow good practice.
The above practice should resolve the issue of file names being different in the different Branches.
If I have a C# solution with multiple projects in it, what would be better, to have the Git repo created in the solution folder, or in each individual project folder? Multiple developers will be working on the projects. What are your experiences with this?
I use several (sometimes overlapping) solutions to contain a collection of related independent applications and shared libraries. As others have mentioned, you really don't want to have a single Git repository containing the source for multiple, independent projects as it makes it much too difficult to track isolated changes.
So, if your solution is structured as mine is then you will definitely want individual Git repositories for each project. This has worked well for me for ten to twelve applications and doesn't create as much maintenance overhead as you might think.
If your solution is truly monolithic (and you're sure you want it that way forever and ever), then it probably makes sense to only have a single repository.
It depends. git repositories are most suited to containing a single configuration item with its own independent lifecycle. If your projects have their own release cycle and are shared between multiple solutions then it might make sense to have them in their own repositories. Usually, though, it is the solution that represents a configuration item with all the constituent projects forming part of the same build. In this case a single git repository at the solution level makes more sense.
git submodule is probably worth consideration here. Each project gets its own repo, the solution gets a repo, and the projects are submodules.
I assume that your solution represents some kind of a product while the projects are just a part of the product.
In this situation I would create the repository on the solution level. This way it is a lot easier to build the whole product at once, especially if the projects depend on each other.
Some though and 3 solutions on the subject can be read on that blog:
https://www.atlassian.com/blog/git/git-and-project-dependencies
package management tool, i.e. nuget in VS, so using reference to a package/compiled module
git submodule (only with command line in VS?)
other build and cross-stack dependency tools
Another solution is just to add a project from the other repo and let it out of the current repo, and latter use the Team Explorer to commit its changes.