Skip to content

Instantly share code, notes, and snippets.

@saman-taghavi
Created July 1, 2023 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saman-taghavi/5b9a98f2e12ffb7af77026477e2e2ff9 to your computer and use it in GitHub Desktop.
Save saman-taghavi/5b9a98f2e12ffb7af77026477e2e2ff9 to your computer and use it in GitHub Desktop.
get git hash in node
revision = require("child_process")
.execSync("git rev-parse HEAD")
.toString()
.trim();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment