Code Monkey home page Code Monkey logo

node-git-tools's Introduction

git-tools

git-tools is a collection of methods to manipulate local git repositories and perform git repository-related functionality.

Install

Install git-tools with npm:

npm install --save-dev @asterics/git-tools

Install with yarn:

yarn add @asterics/git-tools --dev

Introduction

Most of the exported functions depend on @asterics/node-utils and git.

API Reference

gitLocalPath( from, name ) deprecated

Deprecated since: v0.1.5

Get path to git repository name starting from in all parent directories.

Available parameters:

  • from: Path to start search from.

  • name: Name of folder containing git repository. The Name

    The name must either be prefixed or an absolute path.

    • auto: search for repository with the name following the prefix.
    • remote: returns "".
    • /path/to/repo: check and return if path is absolute.

Returns:

Local path to git repository. "" (empty string) if not available.

checkoutSubmodule( { name, destination, branch, fatality }, verbose )

Check out git submodule.

Available properties:

  • name: Name of submodule.
  • destination: Path to submodule.
  • [branch]: Branch to check out (default: "master").
  • [fatality]: Abort program on error (default: false).
  • [verbose]: Verbose logging (default: false).

ensureGitSubmodule( { name, destination, reference, branch, fatality }, verbose )

Clone git submodule.

Available properties:

  • name: Name of submodule.
  • destination: Path to submodule.
  • [reference]: Local reference to git repository of submodule (default: "").
  • [branch]: Branch to check out (default: "master").
  • [fatality]: Abort program on error (default: false).
  • [verbose]: Verbose logging (default: false).

getReferenceInPath( path, name )

Get reference to git repository name searching path and parent directories.

Available parameters:

  • path: Path to search (incl. parent directories).
  • name: Directory name containing git repository.

Returns:

Path to reference git repository. "" (empty string) if none available.

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.