Coder Social home page Coder Social logo

rw-git's Introduction

License: MIT

About

rw_git is a git wrapper that facilitates the out-of-the-box execution of common git operations.

Documentation

Features

rw_git offers a variety of features which are separated into relevant classes. To use this library you can either refer directly to the class which implements the implementation needed, or refer to an instance of it through the RwGit class.

GitCommon

  • init: Initialize a local GIT directory. If the local directory does not exist, it will be created.
  • clone: Clone a remote repository into a local folder. If the local directory does not exist, it will be created.
  • checkout: Checkout a GIT branch on the specified, existing directory.
  • fetchTags: Retrieve a list of tags of the specified repository.
  • getCommitsBetween: Retrieve a list of commits between two given tags.

GitStats

  • stats: Get the number of lines inserted, deleted and number of files changed.
  • contibutionsByAuthor: Returns the number of contributions for every author of the repository.

Getting started

pubspec.yaml: rw_git: 1.0.3

Usage

Import library:

import 'package:rw_git/rw_git.dart';

Initialize RwGit:

RwGit rwGit = RwGit();

Clone a remote repository:

String localDirectoryToCloneInto = _createCheckoutDirectory(localDirectoryName);
rwGit.gitCommon.clone(localDirectoryToCloneInto, repositoryToClone);

Fetch tags of a remote repository:

List<String> tags = await rwGit.gitCommon.fetchTags(localDirectoryToCloneInto);
print("Number of tags: ${tags.length}");

Retrieve the commits between two tags:

  List<String> listOfCommitsBetweenTwoTags = await rwGit.gitCommon.getCommitsBetween(localDirectoryToCloneInto, oldTag, newTag);
  print("Number of commits between $oldTag and $newTag: ${listOfCommitsBetweenTwoTags.length}");

Retrieve code-change statistics between two tags:

  ShortStatDto shortStatDto = await rwGit.gitStats.stats(localDirectoryToCloneInto, oldTag, newTag);
  print('Number of lines inserted: ${shortStatDto.insertions}'
      ' Number of lines deleted: ${shortStatDto.deletions}'
      ' Number of files changed: ${shortStatDto.numberOfChangedFiles}');

Additional information

Please file any issues on the github issue tracker.

rw-git's People

Contributors

gbrandtio avatar

Stargazers

 avatar Meo avatar santosh avatar

Watchers

Kostas Georgiou avatar  avatar

rw-git's Issues

clone ProcessException: Unknown error

android emulator on macOS 14.1(CPU: M1 Pro)

image: Android 11 arm64

final rwGit = RwGit();
final result = rwGit.clone(dataPath, 'https://github.com/gbrandtio/rw-git.git');
print(result == true ? 'success' : 'failed');
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.