We have been using the local file system (FS) to store the states. However, and since this a pluggable interface, we can add more FS to the master. One of the FS available is the GitFS. The GitFS allows us to develop states and commit them to a repository that in later being cloned inside our master.

This means that we can store our Salt data in any platform we choose, assuming a Salt fileserver module has been written for that platform.

GitFS allows us to specify a remote Git repository from which Salt will fetch files. Branches in the repository will correspond to the Salt environments of the same name. The exception is the master branch; if it exists—the master branch becomes the base environment.

To configure the GitFS, inside the master configuration:

fileserver_backend:
 - roots
 - git

GitFS will query both a GitHub repo, using the git:// protocol and a repo located on the master filesystem, /var/git/saltmaster, using the file:// protocol

gitfs_remotes:
 - git://github.com/xxx/xxx.git
 - file://var/git/saltmaster

<aside> đź’ˇ Branches and tags become Salt fileserver environments. Branching and tagging can result in a lot of potentially-conflicting top files, for this reason it may be useful to set top_file_merging_strategy to same in the minions' config files if the top files are being managed in a GitFS repo.

</aside>