This interface provides access to various commands of git. Compared to the direct call to git command, this module provides a more easy-to-use package interface and provides automatic detection and cross-platform processing for git.
This interface corresponds to the git clone command.
import("devel.git")
git.clone("[email protected]:tboox/xmake.git")
git.clone("[email protected]:tboox/xmake.git", {depth = 1, branch = "master", outputdir = "/tmp/xmake"})
This interface corresponds to the git pull command.
import("devel.git")
git.pull()
git.pull({remote = "origin", tags = true, branch = "master", repodir = "/tmp/xmake"})
This interface corresponds to the git clean command.
import("devel.git")
git.clean()
git.clean({repodir = "/tmp/xmake", force = true})
This interface corresponds to the git checkout command
import("devel.git")
git.checkout("master", {repodir = "/tmp/xmake"})
git.checkout("v1.0.1", {repodir = "/tmp/xmake"})
This interface corresponds to the git ls-remote --refs command
import("devel.git")
local refs = git.refs(url)
This interface corresponds to the git ls-remote --tags command
import("devel.git")
local tags = git.tags(url)
This interface corresponds to the git ls-remote --heads command
import("devel.git")
local branches = git.branches(url)