std.lib.git
add
(add arg)(add arg opts)adds files to the index
(git/add “.”) (git/add {:all true}) (git/add “file1” “file2”)
branch
(branch)(branch name-or-opts)(branch name opts)branch operations
(git/branch) ;; list branches (git/branch {:root ""}) ;; list branches in repo (git/branch “feature”) ;; create branch (git/branch “feature” {:delete true})
checkout
(checkout branch)(checkout branch opts)checkouts a branch
(git/checkout “main”) (git/checkout “feature” {:create true})
clone
(clone url)(clone url opts)clones a git repository
(git/clone “https://github.com/…”) (git/clone “https://github.com/…” {:dir “target”})
commit
(commit arg)(commit msg opts)commits changes
(git/commit {:message “hello”}) (git/commit “message”)
git
(git args)(git args opts)generic git command
(git “status”) (git [“commit” “-m” “hello”]) (git “status” {:root “…”})
merge-branch
(merge-branch branch)(merge-branch branch opts)merges a branch
(git/merge-branch “feature”)
rebase
(rebase upstream)(rebase upstream opts)rebases current branch onto upstream AUTO-RECOVERS on failure by aborting.
(git/rebase “origin/main”)
reset
(reset commit)(reset commit opts)resets the repo
(git/reset “HEAD~1” {:mode :soft})
status
(status)(status opts)returns the git status as a map
(git/status) => {:branch “main” :changed “file1.txt” :staged “file2.txt”}
submodule
(submodule action)(submodule action opts)manages submodules
(git/submodule :update) (git/submodule :init) (git/submodule :sync)