How to save physical folder folders for git as available in TFS?

We have a huge product, and it has many functions, each of which takes a very long time, so we support short-lived function branches in TFS. For instance,

MAIN/ PROJECTMGT EMAILMGT etc.. 

And upon completion, they merge back into MAIN, and each development team works in different branches.

Merger process

Since each team works in different branches, there are no conflicts, however, the person responsible for merging the branches in MAIN should see a clear view of the files in different folders. Since we need to check and analyze a branch before merging, we also need to see the conflict of different branches and clearly figure it out.

Now we are switching to git, and while studying git, I am a bit at a loss how to organize branches. While we are working on the structure of files and folders, we have no idea which branch we are in.

We just tested the git test, and most of us who work with multiple branches are confused, and we also made merge errors.

TFS automatically merges everything into one branch, where the file actually belongs without specifying the branch.

I read about it, and I saw some suggestion to create several clones to emulate the type of branching of a physical folder like TFS.

Can anyone help me how can I do this? I am using Visual Studio Tools for Git.

UPDATE

Based on the comments, here are our current difficulties.

  • Each branch has separate versions of NuGet packages, for example, one branch can use EF 5, and the new branch has EF 6, the switching branch is painful, as it requires the restoration of nuget and all its warnings.

  • Like the nuget package, we have other third-party libraries (binaries) and its different versions in different branches.

  • During the merger, this is a mess, we continue to ask ourselves which branch we are in, however in VS it is easy, since the path to the physical folder tells us our branch.

  • It seems to me stupid to remember which branch we were when I checked three days ago. Although VS Git Tools displays it when you go into the source code explorer, it also does not work when we open several VS instances.

  • We are looking for a workflow to never use SWITCH BRANCH.

+6
source share
1 answer

Based on the comments on the question, this will be the answer to the question of how to create several clones (possibly with verified branches).

However, this is probably not the best solution for the following reasons:

  • Each additional clone uses additional disk space.

  • Using extra clones is probably not the best way to simplify merging. It is very unconventional to handle merge problems this way in git.

  • Using extra clones may not be the best way to facilitate testing.

Step 1. Create a local clone

Since you mentioned that you are using GitHub, you need to take this step if you do not already have a local clone.

 git clone <url-to-repo> 

This will clone your repo and automatically check for the master branch, assuming the master branch is the default branch that you installed on GitHub.

Step 2: Create a clone for each branch you need

If you have N additional branches that require a separate check, 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 use at least as much disk space as the original. It may be possible to reduce the space used with the --shared or --reference options for git clone , but I don't know enough about how these options work.

Documentation

+2
source

All Articles