Git Fileserver Backend

With this backend, branches and tags in a remote git repository are exposed to salt as different environments.

To enable, add git to the fileserver_backend option in the Master config file.

  - git

The Git fileserver backend supports both pygit2 and GitPython, to provide the Python interface to git. If both are present, the order of preference for which one will be chosen is the same as the order in which they were listed: pygit2, then GitPython.

An optional master config parameter (gitfs_provider) can be used to specify which provider should be used, in the event that compatible versions of both pygit2 and GitPython are installed.

More detailed information on how to use GitFS can be found in the GitFS Walkthrough.


Minimum requirements

To use pygit2 for GitFS requires a minimum pygit2 version of 0.20.3. pygit2 0.20.3 requires libgit2 0.20.0. pygit2 and libgit2 are developed alongside one another, so it is recommended to keep them both at the same major release to avoid unexpected behavior. For example, pygit2 0.21.x requires libgit2 0.21.x, pygit2 0.22.x will require libgit2 0.22.x, etc.

To use GitPython for GitFS requires a minimum GitPython version of 0.3.0, as well as the git CLI utility. Instructions for installing GitPython can be found here.

To clear stale refs the git CLI utility must also be installed.