You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/input/docs/usage/cli/output.md
+21
Original file line number
Diff line number
Diff line change
@@ -14,3 +14,24 @@ out the variables to whatever build server it is running in. You can then use
14
14
those variables in your build scripts or run different tools to create versioned
15
15
NuGet packages or whatever you would like to do. See [build
16
16
servers](/docs/reference/build-servers) for more information about this.
17
+
18
+
You can even store the [variables](/docs/reference/variables) in a Dotenv file
19
+
and load it to have the variables available in your environment.
20
+
For that you have to run `GitVersion.exe /output dotenv` and store the output
21
+
into e.g. a `gitversion.env` file. These files can also be passed around in CI environments
22
+
like [GitHub](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#passing-values-between-steps-and-jobs-in-a-workflow)
23
+
or [GitLab](https://docs.gitlab.com/ee/ci/variables/#pass-an-environment-variable-to-another-job).
24
+
Below are some examples of using the Dotenv format in the Unix command line:
25
+
```bash
26
+
# Output version variables in Dotenv format
27
+
gitversion /output dotenv
28
+
29
+
# Show only a subset of the version variables in Dotenv format
30
+
gitversion /output dotenv | grep -i "prerelease"
31
+
32
+
# Show only a subset of the version variables that match the regex in Dotenv format
0 commit comments