Basic git support for Garry's Mod
require("gm_git")
local repo, err = git.open("./garrysmod/addons/adminsystem")
if (err) then
error("git repo open error: " .. err)
end
-- Fetches the current branch and fast-forwards it if possible, using system credentials.
local err = repo:fetch()
if (err) then
error("unable fetch git repo: " .. err)
end
-- Returns the identifier (hash) of the current commit in the repository.
local commit = repo:get_commit_id()
print(commit) -- 337dbd2f46a4ebae44dd754e7d5113feac397ac8
-- Returns the name of the current branch the repository is on.
local branch = repo:get_branch()
print(branch) -- main| Architecture | Download |
|---|---|
| Windows x32 | Download |
| Windows x64 | Download |
| Linux x32 | Download |
| Linux x64 | Download |
Note
All possible targets can be viewed in Build workflow.
cargo build --release --target <target>