Work on two branches of the same repository at once - visual-studio

I recently started working on a different branch of my repository, but I noticed that I had not merged my work from an earlier branch yet. I figured I could copy and paste the missing pieces over from one branch to the other but I'm not sure if I can open them in parallel in two separate instances of Visual Studio.

I believe you can still merge your previous branch into the one you are working on?
If you really really need to have both versions open at the same time, you could clone the same repository into another, seperate, folder and have the previous branch there and open that version of the project.

Related

Pulling a branch into xcode gets the files but not the changes to add them to project itself

I'm going up to a cottage for a couple of days and would like to work on one of my pet projects. I'll be using my wife's MBA so I'm trying to pull the latest branch from GitHub.
On GitHub there are two branches, master and the current branch, glib-remove. The main difference in the latter is the addition of two new files, data.h and data.c and changes to the Xcode project file to add them.
When I pulled the branch to the MBA I was mystified, as the files did not appear in the project. It turns it they were pulled, but the project file doesn't have them included. I'm a bit of a loss why this might be. The project is listed as clean on the original machine, it's definitely in the repo, but doing a pull on that file on the MBA does nothing.
Can someone suggest why this might be happening? It's easy enough to simply add the files to the project manually, but I'd like to know what's going on so I can avoid it in the future.

TFS - Creating a Branch from Label, Impact on shared projects

Our TFS Source Control is setup like this:
TFS Project
Solutions
WebApp1Solution
WebApp2Solution
Libraries
SharedLibrary1
Web Applications
WebApp1
WebApp2
When I open solution WebApp1Solution, it loads my workspace with projects from Libraries and Web Applications folder.
I would like to suspend my current workspace environment for both web apps and all shared libraries and start working on a specific version of this code from an earlier label (our last deployment). We do not have any branching as of yet.
From what I've read, I think these are my options:
1. Shelve pending changes on the solution and get the specific label version of the solution. What would happen when I check any changes back in?
2. Create a branch in Source Control from the specific label version. Would I have to create the branch on all of the folders in the different locations? How would I switch back and forth between my current code and new branch code?
Any help or advice will be greatly appreciated! Thanks!
Just create a branch at your TFS Project folder into a development folder. You should actually be doing this normally for all of your development. Your mainline branch should never contain anything except for your production deployable codebase. You should always be able to get latest of your mainline and build and run as the production end product.
All developers/teams of developers should have their own TFS folder where they can branch from mainline, make changes, test, etc... then once it has passed all approvals, merge it to mainline and destroy your devline.
As for "switching" your branch is a separate folder from your mainline. You can open both at the same time in different instances of Visual Studio, just like opening two solutions at once. Branching creates a copy of the folder/solution/project structure from the point of your branch. Then when you merge it back it reports differences and attempts to merge. If there are conflicts you will be prompted to review and resolve them. Most of the time TFS does a good job at auto-resolving, but I always carefully review all conflicts before selecting a method of resolution.

How clone duplicate existing project in SonarQube

I have one Project in SonarQube with some history and some Confirmed Issues and I need split this project, because of two versions of source code, but I need the history and Issue changes in both projects. How to do this? It is possible somehow clone, duplicate existing Project to another one with different name?
Cloning or duplicating a project is not supported.
You can use the Time machine functionality of SQ to "recreate" the past analyses of the project under another name but it won't recreate the history of changes on issues.

VisualSVN VS2010 merge failing

Our company is migrating from VSS to SVN as part of an upgrade from VS2005 to VS2010. I am evaluating the VisualSVN implementation – VisualSVN Server looking after the repository, and using VisualSVN Client inside VS2010. Our work is predominantly Web Application Projects.
I am having real problems merging a branch back to the trunk
Here is the scenario (all SVN actions being performed with the VS2010 VisualSVN plugin):
In a given WAP, I have created a branch from the /trunk called /branches/test and configured it to run under local IIS in VS2010 with the branch held on my HDD away from the repository (which is on a server)
I’ve edited the homepage in /branches/test to add HELLO WORLD to the WAP’s default.aspx and committed it to /branches/test
I can verify through the VisualSVN browser, that the trunk version doesn’t have the HELLO WORLD, but the branch one does
I now switch to the trunk in VS2010 I get a warning “There are changes in the working copy. It is recommended to commit or revert them before switching” – an additional commit just tells me nothing has changed (which is right) so I continue
Now in the trunk, I confirm there is nothing to commit just to be sure
Still in the trunk, I select “Merge…” followed by “Reintegrate a branch”, set the From URL as [path]/branches/test and the Merge Depth as “Working Copy”
I get an error, “Cannot reintegrate into a working copy that has local modifications".
Have I got something fundamentally wrong in my understanding of branching here, is my process flawed along the way or is this a feature of VisualSVN?
Thanks
Sounds like a bug in this VisualSVN client thing. Normal Subversion doesn't behave like this.
I've found the problem - it was versioning the solution file, which wasn't showing in VS 2010 by default. Therefore I did have uncommitted changes on the local working copy which I wasn't aware of (the solution file).
I'm not sure of the best way forward here. Should I exclude the solution file (.sln) or version it? My worry is that if it's excluded and I add a project in a branch and merge back to the trunk, when the next person branches from the trunk will they run into problems (as the solution file in their own working copy will not include the new project)?
(I'm new to StackOverflow - should this be posted as a separate question?)

TFS not showing Dev branch in target locations for merging

s/w versions:
TFS2008 server, VS2010, windows xp
I have the following branch structure in TFS
$/Root/Main Branch
$/Root/Dev/Project1
Project1 was branched off the Main Branch, few months ago. Now I need to merge the latest code in the Main Branch to the Project1 branch. During that time, some new folders were added to the Main Branch.(Main Branch/CoreDataClasses/..). So when I try to merge this new folder into the Project1 branch using the merge wizard, I don't see the Project1 branch in the list of target branches. Why is TFS not showing me my dev branch in the target branches list?
Do your merge from the root (where you branched), not the individual folder(s). Remember that merges aren't destructive until you check in, so you can choose to only check in the new folders if you want to hold off other changes.
With Tfs I've had much better experience merging from branch to the trunk and I think this might be the case here. Of course this might take a rethink of your strategy but it's doable.
I know this may be way offside but if you're doing cross branch merging a lot then definitely consider a distributed version control system like mercurial. I've used Tfs lots and really like it but when it comes to branching and merging it is a distant second to hg merge (mercurial command)
The folder structure between source and target have to be the at least 80% the same. If there was too many restructuring of the folder layout then I suggest you use the cmd line Merge with the force switch when doing the merge. See "Merge Command".

Resources