JavaScript implementation to get the git commit hashes for different references.
- current branch (current)
- local branches (heads)
- remote branches (remotes)
- tags (tags)
Tags aren't currently implemented, because they require being able to read the tag commit object. The other references just require reading the file contents.
npm install @sinet/git-refs --save
const gitRefs = require( '@sinet/git-refs' );
gitRefs( '/path/to/.git', function ( error, refs ) {
if ( error ) {
return console.log( error );
}
console.log( "refs.current.head:", refs.current.head );
console.log( refs );
} );
All pull requests must follow coding conventions and standards.