teambition / gulp-ssh

SSH and SFTP tasks for gulp
184 stars 38 forks source link

Entering password for `git pull` when using `gulp-shell` #62

Closed imfaisalkh closed 7 years ago

imfaisalkh commented 7 years ago

I'm using gulp-ssh plugin to have ssh connection to my remote server and then execute shell commands over there. I'm using following gulp code:

gulp.task('deploy', function () {
  return gulpSSH
    .shell(['cd /home/username/public_html/example.com', 'git pull'], {filePath: 'shell.log'})
    .pipe(gulp.dest('logs'))
})

This code executes first shell command successfully, but when it comes to git pull it gets stuck there without any message or error. The output is something like below:

[15:41:01] Using gulpfile C:\wamp64\www\example.com\gulpfile.js
[15:41:01] Starting 'deploy'...
[15:41:06] gulp-ssh :: shell :: cd /home/username/public_html/example.com
[15:41:06] gulp-ssh :: shell :: git pull

My understanding is that it's because git pull asks for a password to execute successfully. But when I execute this gulp task it does not ask for any password. How should I proceed from here?

Note: I'm using https url for the remote destination of my git repository.

zensh commented 7 years ago

sorry, it does not support that

imfaisalkh commented 7 years ago

Okay, so to use git pull can we only use SSH method to connect our remote server with git repository (since it is not supposed to ask for password on git command)?

zensh commented 7 years ago

You can try to add SSH keys to git server

imfaisalkh commented 7 years ago

Thanks, I can confirm that it works with SSH key method. I'm closing this issue now.