Sto lavorando al progetto e voglio commettere e spingere su git usando by gulp ma sto affrontando qualche problema quando sto eseguendo git task così push quindi task non è in attesa di commit ....Gulp Git esegue prima attività di commit e poi spinge attività
Chiunque può fare il mio aiuto! Voglio rendere il compito come prima esecuzione commit e quindi spingere automaticamente e non eseguire attività push fino a completare l'attività di commit ....
Gulp Task per Gulp Git Commit e Push!
var gulp = require('gulp'),
runSequence = require('run-sequence'),
gutil = require('gulp-util'),
git = require('gulp-git'),
prompt = require('gulp-prompt');
/* task to commit and push all file on git
******************************************************************/
// git commit task with gulp prompt
gulp.task('gulp:commit', function(){
// just source anything here - we just wan't to call the prompt for now
gulp.src('./*')
.pipe(prompt.prompt({
type: 'input',
name: 'commit',
message: 'Please enter commit message...'
}, function(res){
// now add all files that should be committed
// but make sure to exclude the .gitignored ones, since gulp-git tries to commit them, too
return gulp.src([ '!node_modules/', './*' ], {buffer:false})
.pipe(git.commit(res.commit));
}));
});
// Run git push, remote is the remote repo, branch is the remote branch to push to
gulp.task('gulp:push', ['gulp:commit'], function(cb){
git.push('origin', 'master', cb, function(err){
if (err) throw err;
});
});
// # task completed notification with green color!
gulp.task('gulp:done', ['gulp:push'], function(){
console.log('');
gutil.log(gutil.colors.green('************** Git push is done! **************'));
console.log('');
});
// gulp task to commit and push data on git
gulp.task('git', function(){
runSequence(['gulp:commit', 'gulp:push', 'gulp:done'])
});
non funziona ... e spingere compito non è in attesa di completamento per commettere compito! – Faizy
Non si restituisce il flusso in ** gulp: commit **. Ho modificato la mia risposta per mostrarti come, provalo e dimmi se funziona. – franmartosr
grazie, questo codice funziona ma ho notato una cosa che non spinge il mio commit corrente ma spingo il commit recente su gitihub! – Faizy