title: How do I use sftp on git-ftp client?
body: <p>I'm trying to use jenkins to automate an sftp upload and replace so that a folder on a sftp server is equal to the git repository. This is using sftp hosted on an openshift running nginx that only supports ftp using an ssh key which I've already generated using their rhc client. I have been able to connect easily to sftp using filezilla using instructions on <a href="https://blog.openshift.com/using-filezilla-and-sftp-on-windows-with-openshift/" rel="nofollow noreferrer">https://blog.openshift.com/using-filezilla-and-sftp-on-windows-with-openshift/</a>. </p>
  
  <p>I found the most useful and time efficiency would be using a tool called git-ftp. </p>
  
  <p>The steps are pretty forward for ftp using a username, password, and ftp server domain. I'm struggling getting it to do sftp using my ssh key.
  Here is a site that I found with the best documentation for commands to use.
  Reference: <a href="http://manpages.ubuntu.com/manpages/trusty/man1/git-ftp.1.html" rel="nofollow noreferrer">http://manpages.ubuntu.com/manpages/trusty/man1/git-ftp.1.html</a>.</p>
  
  <p>I was following this guide to get the Jenkins automation setup
  <a href="https://www.savjee.be/2016/02/Use-Jenkins-and-git-ftp-to-deploy-website-to-shared-webhosting/" rel="nofollow noreferrer">https://www.savjee.be/2016/02/Use-Jenkins-and-git-ftp-to-deploy-website-to-shared-webhosting/</a>. However, this doesn't show the command to use sftp.</p>
  
  <p>I used <a href="https://tohin.wordpress.com/2014/02/11/git-and-sftp/" rel="nofollow noreferrer">https://tohin.wordpress.com/2014/02/11/git-and-sftp/</a> to try a few different commands without much luck.</p>
  
  <p>Supposedly this works with ftp only giving username, password, and ftp server:</p>
  
  <pre><code>git ftp init --user USERNAME --passwd PASSWORD ftp://YOUR-FTP-SERVER-ADDRESS/path/to/website/
  </code></pre>
  
  <p>I've adjusted mine to be:</p>
  
  <pre><code>git ftp init -u &lt;openshiftsshtoken&gt; --sftp-key ~/.ssh/id_rsa  sftp://YOUR-FTP-SERVER-ADDRESS/app-root/data/html/&lt;foldertouploadto&gt; 
  </code></pre>
  
  <p>But it's throwing me some errors.</p>
  
  <p>I want to do a git ftp push after initializing it and making sure the sftp works. E.g. </p>
  
  <pre><code>git ftp push -u &lt;openshiftsshtoken&gt; --sftp-key ~/.ssh/id_rsa  sftp://YOUR-FTP-SERVER-ADDRESS/app-root/data/html/&lt;foldertouploadto&gt;
  </code></pre>
  
  <p>Could someone point out the errors that I have?</p>