Given a VS solution with one or more projects that have the GitVersionTask NuGet package installed, GitVersion will look only in the solution dir for GitVersion.yml and will ignore any GitVersion.yml in the applicable project dir.
The docs at http://gitversion.readthedocs.io/en/latest/configuration/ say that I should be able to put the config file in any solution subdirectory, "in case you have a single repository for more than one project" and want to set different GitVersion parameters on each.
GitVersion CLI run from the project directory behaves correctly.
See #1124 for more discussion, and especially https://github.com/GitTools/GitVersion/issues/1124#issuecomment-269882437
Hi all, I want to share a workaround that seems to be working:
After that you might want to roll back the change or not - depending on your need. For me it seems it is nice to scope down to the only nuget package from the collection of nuget packages in our nugetPackages monorepo.
Forgive me for being confused but how does this help in versioning per project in a single git repo?
-- root (where the .git is)
+- project1
+- gitversion.yml
+- project2
+- gitversion.yml
+- gitversion.yml
If the git version ymls in the project subfolders are honored, can i have a different version for project1 and project2?
Like,
I believe the major and minor versions are based on tagging, the patch number could be by tag or commit number and the build number is based on commits since the last tag.
How do I set this up? Do I need to have a specific format for tags to say that that tag is meant for project1?
Is it possible to setup commit count tracking by folder too?
Any further comments on this scenario? I can see how @gparlakov workaround would handle the M.M.P versions as you could control these in the gitversion config scoped per solution, but @isen-ng point is that the pre-prelease tags will still need some way to be generated per solution.
I can't see any other way of achieving this for a mono-repo setup.
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.
This is exactly what I am trying to do right now, how can I help move this forward?
This is also for me exactly what I need for my project.
Any news on this?
This also applies to GitVersion.yml in the git root directory, when the solution file resides in a subdirectory...
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.
Is this still a problem in GitVersion 5?
Is there any documentation on how to do this? A quick and dirty try gave me this error.
➜ src git:(master) ✗ gitversion
INFO [02/01/20 0:19:30:35] Working directory: /Users/ranjan/workspace/github/gitversion-test/srcINFO [02/01/20 0:19:30:37] IsDynamicGitRepository: FalseINFO [02/01/20 0:19:30:38] Returning Project Root from DotGitDirectory: /Users/ranjan/workspace/github/gitversion-test/.git/ - /Users/ranjan/workspace/github/gitversion-test/WARN [02/01/20 0:19:30:38] An error occurred:
Ambiguous config file selection from '/Users/ranjan/workspace/github/gitversion-test/src/GitVersion.yml' and '/Users/ranjan/workspace/github/gitversion-test/GitVersion.yml'%
Any update on versioning per monorepo subfolder?
Versioning differently in different subfolders based on different tag-prefixes worked well for me in 5.
@brunobertechini Do you have some specific problem?
@marcusl can you please point me to any documentation about it? I couldn't make it work.
Set tag-prefix different in yaml and run gitversion in each folder is what I've done.
https://gitversion.net/docs/configuration <- tag-prefix is documented there.
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Any news on this?