Giter VIP home page Giter VIP logo

git-rev-sync's Introduction

git-rev-sync

Build Status

Synchronously get the current git commit hash, tag, branch or commit message. Forked from git-rev.

Example

var git = require('git-rev-sync');

console.log(git.short());
// 75bf4ee

console.log(git.long());
// 75bf4eea9aa1a7fd6505d0d0aa43105feafa92ef

console.log(git.branch());
// master

console.log(git.message());
// initial commit

console.log(git.tag());
// not implemented

console.log(git.log());
// not implemented

You can also run these examples via: npm run examples

Install

npm install git-rev-sync --save

API

var git = require('git-rev-sync');

git.short() → <String>

return the result of git rev-parse --short HEAD

git.long() → <String>

return the result of git rev-parse HEAD

git.branch() → <String>

return the current branch

git.message() → <String>

return the current commit message; this method will fail if the git command is not found in your PATH

License

MIT

git-rev-sync's People

Contributors

tblobaum avatar junosuarez avatar kurttheviking avatar marcoceppi avatar defunctzombie avatar

Watchers

 avatar

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.