dnys1 / git

A dart wrapper around the git command line binary

Home Page:https://pub.dev/packages/git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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');
  }
}

About

A dart wrapper around the git command line binary

https://pub.dev/packages/git

License:BSD 2-Clause "Simplified" License


Languages

Language:Dart 100.0%