Skip to content

Commit 477a7fc

Browse files
author
Oren Novotny
committed
update docs
1 parent da291a9 commit 477a7fc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/usage/command-line.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ This can be done for *.cs, *.vb and *.fs files.
3636

3737
When requesting that GitVersion generate an assembly info file you are limited to only specifying a single `<filename>` within the `/updateassemblyinfo` switch, this is to prevent the creation of mulitple assembly info files with the same assembly version attributes. If this occurs your build will fail.
3838

39+
Optionally, you can have GitVersion skip/ignore an `AssemblyVersion` attribute with the `/excludeUpdateAssemblyVersion` switch. This may be useful in cases where strict control is needed over the `AssemblyVersion` for binding redirects.
40+
3941
### Example: When AssemblyInfo.cs does not exist
4042
`GitVersion.exe /updateassemblyinfo AssemblyInfo.cs /ensureassemblyinfo`
4143

@@ -46,6 +48,11 @@ A file is generated that contains version attributes (`AssemblyVersion`, `Assemb
4648

4749
All known attributes (`AssemblyVersion`, `AssemblyFileVersion`, `AssemblyInformationalVersion`) will be updated
4850

51+
### Example: When AssemblyInfo.cs already exists
52+
`GitVersion.exe /updateassemblyinfo AssemblyInfo.cs /ensureassemblyinfo /excludeUpdateAssemblyVersion`
53+
54+
Some attributes (`AssemblyFileVersion`, `AssemblyInformationalVersion`) will be updated, `AssemblyVersion` will be ignored.
55+
4956
### Example: When AssemblyInfo.cs and AssemblyVersionInfo.cs do not exist
5057
`GitVersion.exe /updateassemblyinfo AssemblyInfo.cs AssemblyVersionInfo.cs /ensureassemblyinfo`
5158

src/GitVersionExe/HelpWriter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ path The directory containing .git. If not defined current directory
3131
# AssemblyInfo updating
3232
/updateassemblyinfo
3333
Will recursively search for all 'AssemblyInfo.cs' files in the git repo and update them
34+
/excludeUpdateAssemblyVersion
35+
Will exclude adding or updating the AssemblyVersion attribute when updating assembly info files
3436
/updateassemblyinfofilename
3537
Specify name of AssemblyInfo file. Can also /updateAssemblyInfo GlobalAssemblyInfo.cs as a shorthand
3638
/ensureassemblyinfo
3739
If the assembly info file specified with /updateassemblyinfo or /updateassemblyinfofilename is not found,
38-
it be created with these attributes: AssemblyFileVersion, FileVersion and AssemblyInformationalVersion
40+
it be created with these attributes: AssemblyFileVersion, AssemblyVersion and AssemblyInformationalVersion
3941
---
4042
Supports writing version info for: C#, F#, VB
4143
# Remote repository args

0 commit comments

Comments
 (0)