Skip to main content

Git

@swamp/gitv2026.08.18.2· 4d agoMODELS
01README

Git repository operations for swamp workflows. Wraps the git CLI and returns structured data (file lists, commit objects, status entries) instead of raw text, making git operations composable in swamp workflows.

Designed for CI automation: change detection via diff, dirty-tree checks via status, push/sync verification via upstream_state, bot commits, and branch management.

Methods

Method What it does
clone Clone a repository with configurable depth, branch, and auth.
diff Show changes between refs — name-only file lists, stat summaries, or full diffs.
status Working tree status with structured entries and clean/dirty flag.
upstream_state Tracking-branch state: configured upstream, tracking-ref availability, ahead/behind counts, pushed/synced flags.
log Commit history with structured entries (SHA, author, date, message).
commit Stage files and create a commit.
push Push commits to a remote (with optional force and set-upstream).
pull Pull changes from a remote (with optional rebase and ff-only).
fetch Fetch refs from a remote with optional tag and prune support.
cherry_pick Cherry-pick commits or abort an in-progress cherry-pick.
branch Create, switch, or list branches.
config Get or set git configuration values.

Usage

swamp extension pull @swamp/git

swamp model create @swamp/git repo
swamp model edit repo

swamp model method run repo diff \
  --input base=HEAD~1 \
  --input nameOnly=true \
  --input 'paths:json=["*/manifest.yaml"]' \
  --json
02Models1
@swamp/gitv2026.08.18.2git.ts
fn clone()
Clone a git repository
fn diff()
Show changes between refs with optional name-only and path filtering
fn status()
Show working tree status with structured output
fn log()
Show commit history with structured entries
fn commit()
Stage files and create a commit
fn push()
Push commits to a remote
fn branch()
Create, switch, or list branches
fn pull()
Pull changes from a remote into the current branch
fn fetch()
Fetch refs from a remote with optional tag and prune support
fn cherry_pick()
Cherry-pick commits onto the current branch, or abort an in-progress cherry-pick
fn config()
Get or set git configuration values
fn upstream_state()
Report tracking-branch state: ahead/behind counts, pushed/synced flags

Resources

cloneResult(ephemeral)— Result of a git clone operation
diffResult(ephemeral)— Changed files and raw diff output from a git diff operation
statusResult(ephemeral)— Working tree status: structured entries, clean/dirty flag, count
logResult(ephemeral)— Commit history with structured entries
commitResult(ephemeral)— Result of a git commit: SHA and message
pushResult(ephemeral)— Result of a git push operation
branchResult(ephemeral)— Branch operation result: current branch, list, or creation status
configResult(ephemeral)— Git config get/set result
pullResult(ephemeral)— Result of a git pull operation
fetchResult(ephemeral)— Result of a git fetch operation
cherryPickResult(ephemeral)— Cherry-pick result: applied commits, conflict status, and conflicting files
upstreamStateResult(ephemeral)— Tracking-branch state: branch, upstream, configuredUpstream, trackingRefAvailable, ahead/behind counts (nullable), pushed/synced flags (nullable)
03Previous Versions5
2026.08.18.1
2026.08.17.1
2026.08.13.1

Modified 1 models

2026.08.07.1

Modified 1 models

2026.08.05.1
04Stats
A
100 / 100
Downloads
184
Archive size
39.4 KB
Verified by Swamp
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms
06Labels