Add specific file to staging area
File path to add
Add multiple files to staging area
Array of file paths to add
Safely checkout to the specified branch with the following steps:
The name of the branch to checkout
Commit staged changes
Commit message
Create branch, commit and push (legacy method)
Branch name
Commit message
Create a new branch
Branch name to create
Extract base URL from Git remote URL with protocol detection
Optional
remoteUrl: stringGit remote URL (optional, will get current remote if not provided)
Base URL (e.g., "https://github.com", "https://gitlab.example.com")
Extract hostname from Git remote URL
Optional
remoteUrl: stringGit remote URL (optional, will get current remote if not provided)
Hostname (e.g., 'github.com', 'gitlab.example.com')
Force re-detection of protocol for hostname (asynchronous)
The hostname to re-detect
Promise
Get the most likely parent branch of the current branch
Base branch name or null if not found or in detached HEAD
Get simplified branch graph visualization (similar to GitLens)
Maximum number of commits to show (default: 20)
String representation of branch graph
Optional
limit: numberGet list of changed files between two branches
Base branch name
Target branch name
Array of changed file paths
Get current branch name
Get current commit hash
Get detected protocol for hostname (synchronous, may return cached result)
The hostname to check
Base URL with detected protocol
Get diff between two branches
Base branch name
Target branch name
Git diff output between branches
Get git diff of specific files (unstaged changes)
Array of file paths to check diff for
Git diff output
Get merge-base commit hash between current branch and target branch
Target branch name
Merge-base commit hash or null if not found
Gets the default remote name for the current repository. Tries to detect the most appropriate remote in the following order:
The default remote name or 'origin' as fallback
Get remote URL for specified remote
Optional
remoteName: stringGet git repository root directory
Get short commit hash
Get target branch for merge request (default branch or fallback)
Target branch name
Check if a remote branch exists
Branch name to check (e.g., 'origin/main')
True if branch exists, false otherwise
Check if repository has staged changes
Check if repository has uncommitted changes
Parse project path from Git remote URL
Optional
remoteUrl: stringGit remote URL (optional, will get current remote if not provided)
Project path (e.g., "user/repo")
Push current branch to remote
Branch name to push
Display comprehensive Git repository information
Get git repository status for all files
Array of GitFileStatus objects representing file changes
Static
clearClear protocol cache for a specific hostname or all hostnames
Optional
hostname: stringOptional hostname to clear, if not provided clears all cache
Static
getGet current protocol cache (for debugging)
Copy of current cache entries
Static
instance
Git operations service