git_on_dart library

Pure Dart git implementation for Flutter

Provides local and remote git operations compatible with standard git format. Optimized for mobile (Android/iOS) with memory-efficient streaming, async operations, and platform-aware file handling.

Classes

AddOperation
Add files to staging area
CheckoutOperation
Checkout branches and restore working tree
CloneOperation
Clone operation
CloneResult
Clone result
CommitOperation
Create commits from staged changes
Credentials
Authentication credentials for remote operations
FetchOperation
Fetch operation
FetchResult
Fetch result
FileMergeResult
File merge result
GitAuthor
GitBlob
Represents a blob object (file content)
GitCommit
Represents a commit object
GitError
Error information for failed operations
GitObject
Base class for all git objects
GitRepository
Main repository class
GitResult<T>
Represents the result of a git operation
GitTree
Represents a tree object (directory listing)
HttpsCredentials
HTTPS authentication with username/password or token
LogOperation
Traverse commit history
LogOptions
Options for log operation
MergeOperation
Three-way merge operation
MergeResult
Merge result
ProgressEvent
Progress event for long-running operations
PullOperation
Pull operation
PullResult
Pull result
PushOperation
Push operation
PushResult
Push result
RebaseCommand
Rebase command for interactive rebase
RebaseOperation
Rebase operation
RebaseResult
Rebase result
Remote
Remote repository configuration
RemoteManager
Remote repository manager
RepositoryStatus
Repository status
SshCredentials
SSH authentication with key pair
StatusEntry
Status entry for a file
StatusOperation
Get repository status
TreeChange
Represents a change in a tree
TreeEntry
Entry in a tree object

Enums

ChangeType
Tree change type
CloneProgress
Clone progress stages
FileStatus
File status
GitFileMode
File mode in git tree
GitObjectType
Type of git object

Typedefs

ProgressCallback = void Function(CloneProgress stage, double progress)
Progress callback for clone operation

Exceptions / Errors

DirtyWorkingTreeException
Working directory has uncommitted changes
FileSystemException
File system operation failed
GitException
Base class for all git exceptions
InvalidConfigException
Invalid configuration
InvalidIndexException
Invalid index file format
InvalidObjectException
Invalid git object or corrupted data
MergeConflictException
Merge conflict detected
OperationCancelledException
Operation was cancelled
ReferenceNotFoundException
Reference (branch/tag) not found
RepositoryNotFoundException
Repository not found or not initialized