Reputation: 39946
We have a huge product and that has many features, each features take very long, so we are maintaining short lived feature branches in TFS. For example,
MAIN/
PROJECTMGT
EMAILMGT
etc..
And once complete, they are merged back to MAIN, and each different development team works on different branches.
Merge Process
Since each team works on different branch, there is no conflict, however person responsible for merging branches onto MAIN needs to see a clear view of files in different folders. Because we need to test and review the branch before merging, we also need to see conflict of different branches and resolve them clearly.
Now we are moving onto git, and as I am learning git, I'm having a little difficulty in how to organize branches. As while working on the file and folder structure, we have no idea of which branch we are actually in.
We just ran a test on git, and most of us who operate on multiple branches got confused and we also made mistakes in merge.
TFS automatically merges everything into same branch where file actually belongs without specifying branch.
I was reading about this and I saw some suggestion of creating multiple clones to emulate TFS kind of physical folder branching.
Can someone guide me how can I do it? I am using Visual Studio Tools for Git.
UPDATE
Based on comments, here are our current difficulties.
Each branch has separate NuGet Package Versions for example one branch might be using EF 5 and new branch has EF 6, switching branch is painful as it requires nuget restore and all its warnings.
Just like nuget package, we have other third party libraries (binaries) and different versions of it in different branches.
At time of merge, its a mess, we keep on asking ourselves which branch we are in, however in VS it is easy as physical folder path tells us our branch.
I find it totally silly to remember which branch we were when I checked out three days back. Though VS Git Tools displays it when you go in Source Code Explorer, but this also fails when we have multiple VS instances open.
We are looking for a workflow without ever to use "SWITCH BRANCH" ever.
Upvotes: 6
Views: 1198
Reputation:
Based on the comments to the question, this will be an answer about how to create multiple clones (possibly with different branches checked-out).
However, this is most likely not the best solution, for the following reasons:
Each additional clone uses additional drive space.
Using additional clones is probably not the best way to make merging easier. It's very unconventional to handle merging issues this way in git.
Using additional clones may not be the best way to make testing easier.
Since you mentioned that you're using GitHub, you'll need to do this step if you don't already have a local clone.
git clone <url-to-repo>
That will clone your repo and automatically check out the master
branch, assuming that the master
branch is the default branch that you have set up on GitHub.
If you have N additional branches that you want to have a separate checkout for, then you can make another clone for each branch by repeating the following:
git clone <path-to-first-local-clone>
git checkout <branch>
Note that each clone will end up using at least as much drive space as the original. It might be possible to reduce the space used by using the --shared
or --reference
options for git clone
, but I don't know enough about how those options work to be sure.
Upvotes: 3