I have a TFS environment with the following branching setup
We're setting ourselves up to use Nuget, and I want to configure things such that code in the Dev branch pulls packages from the 'Dev' nuget repository, main from the 'Main' one, etc.
Now, I've figured things out to the point where I have a single file sitting the root of my branch that tells nuget.exe which repository to use.
I'm now trying to figure out how to have the contents of those files different in each of those branches. I can check them in to each branch separately, but that will introduce problems with merging from Dev->Main and Main->HotFix.
So, I think what I want to do is somehow exclude this particular config file from being part of merges from Dev->Main, etc. Any way to do that?
Or, alternatively, is there some other way to accomplish what I want to do with Nuget, in terms of pointing it to different nuget repositories for different branches?
You'll have to do some trickery...
<configuration>
<packageSources>
<add key="Branch X packages" value="http://www.myget.org/F/corpxyzbranchxyz" />
</packageSources>
<disabledPackageSources />
<activePackageSource>
<add key="Branch X packages" value="http://www.myget.org/F/corpxyzbranchxyz" />
</activePackageSource>
</configuration>
This does mean that you'll have to have a different nuget.config file per branch and that you should be careful when merging/branching.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With