Closed surfjedi closed 5 years ago
You mean the full 40-character SHA-1 commit hash?
I think the only way to do this with git describe
on the command line is with the argument --abbrev=40
(or a larger number than 40 to be forward compatible in case Git ever changes to a hash longer than SHA-1).
With this module you can pass the abbrev
argument through the customArguments
option like this:
gitDescribe(__dirname, {
customArguments: ['--abbrev=40']
})
.then((gitInfo) => { /* ... */ })
.catch((err) => { /* ... */ });
How do I get long hash?