Получите последнюю GIT Commit SHA-1 в репозитории JS

require('child_process').exec('git rev-parse HEAD', function(err, stdout) {
    console.log('Last commit hash on this branch is:', stdout);
});
Cheerful Chimpanzee