git 2.0.0 icon indicating copy to clipboard operation
git: ^2.0.0 copied to clipboard

Git command line wrapper. Exposes a Git directory abstraction that makes it easy to inspect and manipulate a local Git repository.

Pub Package CI

Exposes a Git directory abstraction that makes it easy to inspect and manipulate a local Git repository.

import 'package:git/git.dart';
import 'package:path/path.dart' as p;

Future<void> main() async {
  print('Current directory: ${p.current}');

  if (await GitDir.isGitDir(p.current)) {
    final gitDir = await GitDir.fromExisting(p.current);
    final commitCount = await gitDir.commitCount();
    print('Git commit count: $commitCount');
  } else {
    print('Not a Git directory');
  }
}
21
likes
130
pub points
90%
popularity

Publisher

verified publisher iconj832.com

Git command line wrapper. Exposes a Git directory abstraction that makes it easy to inspect and manipulate a local Git repository.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.BSD-2-Clause (LICENSE)

Dependencies

path

More

Packages that depend on git