diff --git a/lib/lifecycles/tag.js b/lib/lifecycles/tag.js index a7b40191d..9de7cd978 100644 --- a/lib/lifecycles/tag.js +++ b/lib/lifecycles/tag.js @@ -25,8 +25,9 @@ function execTag (newVersion, pkgPrivate, args) { } checkpoint(args, 'tagging release %s%s', [args.tagPrefix, newVersion]) return runExec(args, 'git tag ' + tagOption + args.tagPrefix + newVersion + ' -m "' + formatCommitMessage(args.message, newVersion) + '"') - .then(() => { - let message = 'git push --follow-tags origin master' + .then(() => runExec(args, 'git rev-parse --abbrev-ref HEAD')) + .then((currentBranch) => { + let message = 'git push --follow-tags origin ' + currentBranch.trim() if (pkgPrivate !== true) { message += ' && npm publish' if (args.prerelease !== undefined) {