utils/git_utils
library
Functions
-
commit(String message, {String? dir})
→ Future<GitResult>
-
Create a commit.
-
createWorktree({String? dir, required String path, required String branch, bool createBranch = true})
→ Future<String?>
-
Create a git worktree.
-
currentBranch({String? dir})
→ Future<String?>
-
Get the current branch name.
-
currentCommit({String? dir, bool short = false})
→ Future<String?>
-
Get the current commit hash.
-
diffBetween(String fromRef, String toRef, {String? dir})
→ Future<String>
-
Get diff between two refs.
-
gitStatus({String? dir})
→ Future<List<GitStatusEntry>>
-
Get git status (porcelain v1 format).
-
hasUncommittedChanges({String? dir})
→ Future<bool>
-
Check if there are uncommitted changes.
-
isGitRepo({String? dir})
→ Future<bool>
-
Check if a directory is a git repository.
-
listWorktrees({String? dir})
→ Future<List<String>>
-
List git worktrees.
-
recentCommits({String? dir, int count = 10, String format = '%h %s'})
→ Future<List<String>>
-
Get recent commit log.
-
removeWorktree({String? dir, required String path, bool force = false})
→ Future<bool>
-
Remove a git worktree.
-
repoRoot({String? dir})
→ Future<String?>
-
Get the repository root directory.
-
runGit(List<String> args, {String? workingDirectory, Map<String, String>? environment})
→ Future<GitResult>
-
Run a git command.
-
stagedDiff({String? dir})
→ Future<String>
-
Get diff for staged files.
-
stageFiles(List<String> files, {String? dir})
→ Future<bool>
-
Stage files for commit.
-
trackingRemote({String? dir})
→ Future<String?>
-
Get the tracking remote for the current branch.
-
unstagedDiff({String? dir})
→ Future<String>
-
Get diff for unstaged files.