मैं प्रोजेक्ट पर काम कर रहा हूं और मैं गलती से गिट पर प्रतिबद्धता और धक्का देना चाहता हूं लेकिन जब मैं गिट कार्य चला रहा हूं तो मुझे कुछ समस्या का सामना करना पड़ रहा है, इसलिए धक्का कार्य के लिए इंतजार नहीं कर रहा है ....गुलप गिट पहले प्रतिबद्ध कार्य को चलाते हैं तो कार्य
कोई भी मेरी मदद कर सकता है! मैं कार्य को पहले रन प्रतिबद्ध करने की तरह बनाना चाहता हूं और फिर स्वचालित रूप से धक्का देता हूं और पूर्ण कार्य कार्य तक पुश कार्य नहीं चलाता ....
गुलप गिट कमिट और पुश के लिए गुल टास्क!
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'])
});
काम नहीं कर रहा है ... और धक्का कार्य कार्य के लिए प्रतिबद्ध के लिए पूरा के लिए इंतजार नहीं कर रहा है! – Faizy
आप स्ट्रीम को ** gulp में वापस नहीं करते हैं: ** ** भी प्रतिबद्ध करें। मैंने आपको यह दिखाने के लिए अपना जवाब संपादित किया कि, कैसे प्रयास करें और मुझे बताएं कि यह काम करता है या नहीं। – franmartosr
धन्यवाद, यह कोड काम कर रहा है लेकिन मैंने एक बात देखी है कि यह मेरी वर्तमान प्रतिबद्धता को धक्का नहीं दे रहा है बल्कि गिटहब पर हालिया प्रतिबद्धता को दबा रहा है! – Faizy