好吧,所以我遇到了问题或者可能不是,我只是不明白。上一次提交Git标签
我正在做的是试图提交并推送提交,但也标记它。
我从一饮而尽运行shell命令这样做,虽然这样有可能有一些做它,
git add [files]
git commit -m [message]
git tag -a [tag name] [branch] -m [message]
然后
git push origin [tag name]
但问题是该标签被推送在前一个提交,而不是我目前提交。
我现在的大口的任务是这样的:
var gulp = require('gulp'),
plugin = require('gulp-load-plugins')({
camelize: true
}),
ghPages = require('gulp-gh-pages'),
run = require('gulp-run'),
prompt = require('gulp-prompt');
module.exports = function() {
console.log('Deployment is running currently, please be patient.');
return gulp.src('modules/**/*')
.pipe(ghPages({
remoteUrl: '[user]@[ip]:[branch]',
branch: '[branch]'
}))
.on('end', function() {
return gulp.src('modules/**/*')
.pipe(prompt.prompt({
type: 'input',
name: 'release',
message: 'Is this a new release? (y/n)',
}, function(res) {
if (res.release == 'y') {
return gulp.src('modules/**/*', {
read: false
})
.pipe(prompt.prompt({
type: 'input',
name: 'releaseNumber',
message: 'What is the new release version number? (e.g. x.x.x)'
}, function(res) {
run('git fetch --all').exec();
run('git tag -a v' + res.releaseNumber + ' [branch] -m "Bump release"').exec();
run('git push origin v' + res.releaseNumber + ' [branch]').exec();
}));
}
}));
});
};
什么是在控制台输出为:
Deployment is running currently, please be patient.
[16:12:28] [gh-pages (branch)] Cloning repo
[16:12:28] [gh-pages (branch)] Checkout remote branch `branch`
[16:12:28] [gh-pages (branch)] Updating repository
[16:12:29] [gh-pages (branch)] Copying files to repository
[16:12:29] [gh-pages (branch)] Adding 1 files.
[16:12:29] [gh-pages (branch)] Committing "Update 2016-11-09T21:12:18.579Z"
[16:12:29] [gh-pages (branch)] Pushing to remote.
[16:12:30] Finished 'deploy' after 12 s
[16:12:30] Finished 'build' after 15 s
? Is this a new release? (y/n) y
? What is the new release version number? (e.g. x.x.x) 0.0.5
$ git tag -a v0.0.5 branch -m "Bump release"
$ git push origin v0.0.5
To [user]@[ip]:[repo]
* [new tag] v0.0.5 -> v0.0.5
正如你可以从图片看,标签ISN不会被放在我目前正在提交的最新的承诺上。它将它添加到以前的提交中。
我也在master
推到另一个[分支]。也许这可能是问题?
'git tag'不会创建提交。 – jthill
没错。它创建标签。提交已经被创建并且被推送到这一行'[16:12:29] [gh-pages(branch)]添加1个文件。 [16:12:29] [gh-pages(branch)]提交“更新2016-11-09T21:12:18.579Z”[16:12:29] [gh-pages(branch)]推向远程。' –
所以你在推动'词汇模块'?这不是创建一个快进合并提交,因此新的哈希?尝试使用git命令复制它,而不使用您的gulp文件。 – jkulak