Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-rev-sync

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-rev-sync

Synchronously get the current git commit hash, tag, or branch

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is git-rev-sync?

The git-rev-sync npm package provides synchronous access to Git repository information, such as the current branch, commit hash, and other metadata. It is useful for embedding Git information into your application, such as for versioning or debugging purposes.

What are git-rev-sync's main functionalities?

Get the current branch name

This feature allows you to retrieve the name of the current branch in the Git repository.

const git = require('git-rev-sync');
const branch = git.branch();
console.log(branch);

Get the current commit hash

This feature allows you to get the full hash of the current commit.

const git = require('git-rev-sync');
const commit = git.long();
console.log(commit);

Get the short commit hash

This feature provides the short version of the current commit hash.

const git = require('git-rev-sync');
const shortCommit = git.short();
console.log(shortCommit);

Get the commit message

This feature retrieves the commit message of the current commit.

const git = require('git-rev-sync');
const message = git.message();
console.log(message);

Get the commit date

This feature allows you to get the date of the current commit.

const git = require('git-rev-sync');
const date = git.date();
console.log(date);

Other packages similar to git-rev-sync

FAQs

Package last updated on 02 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc