Support for the Git SCM
Export a tarball from the repository
If prefix is not specified it defaults to the basename of the repo directory.
CLI Example:
salt '*' git.archive /path/to/repo /path/to/archive.tar.gz
Checkout a given revision
CLI Examples:
salt '*' git.checkout /path/to/repo somebranch user=jeff
salt '*' git.checkout /path/to/repo opts='testbranch -- conf/file1 file2'
salt '*' git.checkout /path/to/repo rev=origin/mybranch opts=--track
Clone a new repository
CLI Example:
salt '*' git.clone /path/to/repo git://github.com/saltstack/salt.git
salt '*' git.clone /path/to/repo.git\
git://github.com/saltstack/salt.git '--bare --origin github'
Returns the git describe string (or the SHA hash if there are no tags) for the given revision
CLI Examples:
salt '*' git.describe /path/to/repo
salt '*' git.describe /path/to/repo develop
Perform a fetch on the given repository
CLI Example:
salt '*' git.fetch /path/to/repo '--all'
salt '*' git.fetch cwd=/path/to/repo opts='--all' user=johnny
Initialize a new git repository
CLI Example:
salt '*' git.init /path/to/repo.git opts='--bare'
Merge a given branch
CLI Example:
salt '*' git.fetch /path/to/repo
salt '*' git.merge /path/to/repo @{upstream}
Perform a pull on the given repository
CLI Example:
salt '*' git.pull /path/to/repo opts='--rebase origin master'
Rebase the current branch
CLI Example:
salt '*' git.rebase /path/to/repo master
That is the same as: git rebase master
Returns the long hash of a given identifier (hash, branch, tag, HEAD, etc)
CLI Example:
salt '*' git.revision /path/to/repo mybranch
Initialize git submodules
CLI Example:
salt '*' git.submodule /path/to/repo.git/sub/repo