"GitVersion init" creates almost empty GitVersion.yml file (3.5.4)
based on the documenation a sample yml file should be created.
To create your config file just type GitVersion init in your repo directory after installing via chocolatey and we will create a sample (but commented out) config file. Uncomment and modify as you need.
My file is almost empty
branches: {}
ignore:
sha: []
I think what you are looking for is gitversion.exe /showconfig And if you want to save it to a file: gitversion.exe /showconfig > GitVersion.yaml
Thx, yes this is more complete. But anyway .. the documentation is not aligned with reality and should be fixed.
+1, this messed me up for a long time!
Could someone submit a pull request to fix this? Either to fix the docs or make an improvement to GitVersion init?
@JakeGinnivan I've had an idea to output the entire Config on init, but I'd like to do so with comments. That's why I've created aaubry/YamlDotNet#152, so we can plug into the serialization and output comments into the YAML file. I haven't figured out how to do it yet, though, which is why I've also created a question on Stack Overflow as well.
Annoyingly, doing gitversion /showconfig >GitVersion.yaml just creates a GitVersion.yaml file with the following contents for me:
INFO [10/16/17 14:08:31:58] Working directory: D:\REDACTED
INFO [10/16/17 14:08:31:58] IsDynamicGitRepository: False
INFO [10/16/17 14:08:31:59] Returning Project Root from DotGitDirectory: D:\REDACTED
ERROR [10/16/17 14:08:31:59] An unexpected error occurred:
System.IO.IOException: The process cannot access the file 'D:\REDACTED\GitVersion.yml' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
at GitVersion.ConfigurationProvider.ReadConfig(String workingDirectory, IFileSystem fileSystem)
at GitVersion.ConfigurationProvider.GetEffectiveConfigAsString(String workingDirectory, IFileSystem fileSystem)
at GitVersion.Program.VerifyArgumentsAndRun()
INFO [10/16/17 14:08:31:59]
INFO [10/16/17 14:08:31:59] Attempting to show the current git graph (please include in issue):
INFO [10/16/17 14:08:31:59] Showing max of 100 commits
@onnodb: Seems like some process is locking your GitVersion.yml file? You can use Lock Hunter to figure out which process it is and kill it.
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.