git — Git operations

Stage, commit, branch, diff, and push via Git. Enable with "git" in your tools array.

WarningThe git tool can push to remote branches. Always review the plan before running tasks that include Git operations.

Functions

FunctionDescription
git.status()Return the current working tree status
git.diff(path?)Show unstaged changes, optionally for a specific file
git.add(path)Stage a file or directory
git.commit(message)Commit staged changes with a message
git.branch(name)Create and switch to a new branch
git.checkout(branch)Switch to an existing branch
git.push(remote?, branch?)Push to remote (default: origin current branch)
git.log(n?)Return the last n commits (default: 10)

Example

terminal
testy-claw run "create a branch called fix/typos, fix all typos in docs/, and commit"

  ✓ git.branch("fix/typos")
  ✓ fs.read("docs/intro.md")  → found 3 typos
  ✓ fs.write("docs/intro.md", <fixed>)
  ✓ git.add("docs/")
  ✓ git.commit("fix: correct typos in docs")
  ✓ Done in 3.2s