Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Usage Details

dkowald edited this page Nov 18, 2019 · 1 revision

Details on usage

Details

The Git command MUST be available on the path.

Each git package must be named (via Include attribute), the name describes the sub-folder used for checkout.

Each git package must have a Uri, describing the source repository.

There are 3 ways to use GitPackages

  1. Versioned - use for strict file selection
  2. Unversioned - use to stay at latest.
  3. Attached - use for updatable.

Each has their own advantage and dis advantages.

Versioned

Versioned GitPackages use a Tags to identify specific version(s).

<ItemGroup>
  <GitPackage Include="Sample"
              Version="2"
              Uri="C:\tmp\Sample" />
</ItemGroup>

Pro

  1. Strict file selection.
  2. Updated on every build.
  3. Use cached clone.

Con

  1. Repository must provide Tags for versions.

Unversioned

These describe only the source repository and target folder.

<ItemGroup>
  <!--Delete SampleNoVersion.ver to refresh-->
  <GitPackage Include="SampleNoVersion"
              Uri="C:\tmp\Sample" />
</ItemGroup>

Pro

  1. Uses cached clone.
  2. Repository doesn't need Tags.

Con

  1. Not updated with the build.
  2. Not strict on files.

To update, either delete the .ver file, or use msbuild GitPackRefresh to get latest.

Attached

Removed in favour of just using git sub-modules