Expand description
Read-only git operations
Functions§
- behind_
upstream_ count - Get number of commits behind upstream
- branch_
exists - Check if a branch exists locally
- commit_
count - Count commits between two refs (exclusive..inclusive)
- current_
branch - Get the current branch name
- current_
dir_ name - Get the current working directory name
- get_
default_ remote_ branch - Get the default remote branch (origin/main or origin/master)
- get_
latest_ stash_ message - Get the message of the latest stash (stash@{0})
- get_
upstream - Get the upstream tracking branch for a local branch, if any
- git_
common_ dir - Get the common git directory (always .git of main repo)
- git_dir
- Get the git directory (.git or .git/worktrees/xxx)
- has_
commits_ to_ undo - Check if HEAD has a parent commit (i.e., we can undo)
- has_
remote_ tracking - Check if a branch has a remote tracking branch
- has_
staged_ changes - Check if working directory has staged changes
- has_
uncommitted_ changes - Check if working directory has any uncommitted changes (staged or unstaged)
- has_
unstaged_ changes - Check if working directory has unstaged changes
- has_
untracked_ files - Check if working directory has untracked files
- head_
commit - Get the current HEAD commit hash
- head_
commit_ message - Get the commit message of HEAD
- is_
detached_ head - Check if HEAD is detached
- is_
git_ repo - Check if we’re in a git repository
- is_
worktree - Check if we’re in a worktree (not the main repo)
- remote_
branch_ exists - Check if a branch exists on remote origin
- short_
commit - Get the short commit hash
- stash_
count - Count stashes
- unpushed_
commit_ count - Get number of unpushed commits on a branch (compared to its upstream)