Felix D.
Felix D.

Reputation: 5143

How to control multiple framework versions of the same project in git

Let's say I have a Project called Tools.

Tools is a ClassLibrary containing ExtensionMethods, Helpers, etc.

Different products use different references Tools compiled in various .net framework versions.

I've worked with TFS for a long time so I have problems migrating to git.

enter image description here

This is the structure I have on disk AND also in the "Source Control Explorer" in Visual Studio.

I am used to use the Visual Studio GUI to Merge and Branch Changesets across Branches.

enter image description here

I was not able to create a similar environment with git. Where I can push from one branch to the other back and forth.

I would like to have just 1 repository for "Tools" while having the different branches stored on disk (checked out or not).

Upvotes: 6

Views: 1082

Answers (2)

emmanuel
emmanuel

Reputation: 775

I think I understand what you want to accomplish based on your comments and I'll propose a solution but please let me state first that the way TFS and GIT work with branches and merges are quite different. In GIT you don't have the need to download every branch to a separate folder like we used to do with TFS; in GIT you work and switch branches on the same working folder quite easily.

If you need have all the branches checked out to be able to build faster (or whatever) what I propose is:

1) Consider one folder/build as the master/trunk/latest (or any terminology you are familiar with) and use that as the main branch
2) Clone the same repo to different folders, each folder representing the build (branch) you want to use
3) In each folder/repo checkout the branch you are going to be working in
4) You can work with the different branches on these folders and push/pull to all the other ones while having only one repo

Please, I repeat again, this is not the ideal way of working with GIT. If you're using newer versions of Visual Studio the integration with GIT works seamlessly.

Upvotes: 2

kosist
kosist

Reputation: 3057

If your application reference Test, then you could have multiple repositories (it is not so bad, so just consider it). Then, Test could be done as submodule (for example, check this link, or you could find plenty of others) in each of your repositories (net452, net461), etc. Then, you could maintain Test at single place - separate repository - and push changes to projects repositories, which use Test.

Upvotes: 0

Related Questions