title: PM2 deploy failed with "Not a git repository" message
body: <p>I encounter a problem in the deployment of my project with pm2.
  I have seen several issues on the subject but they are all closed and no solution is proposed in them.</p>
  
  <p>I have successfully done this command 
  <code>pm2 deploy ecosystem.config.js preproduction setup</code></p>
  
  <p>but when I try to deploy
  <code>pm2 deploy ecosystem.config.js preproduction</code></p>
  
  <p>I have this error : </p>
  
  <pre><code>Not a git repository
  To compare two paths outside a working tree:
  usage: git diff [--no-index] &lt;path&gt; &lt;path&gt;
  
    commit or stash your changes before deploying
  
  Deploy failed
  </code></pre>
  
  <p>here is my ecosystem.config.js</p>
  
  <pre class="lang-js prettyprint-override"><code>module.exports = {
    apps: [
      {
        "name": "swizi-chat",
        "script": "./src/index.js",
        "env-preproduction": {
  
        },
      },
    ],
    deploy: {
      preproduction: {
        "host": "x.x.x.x",
        "user": "node",
        "ref": "origin/master",
        "repo": "git@gitlab.com:myproject.git",
        "path": "/var/nodejs/my-project",
        "post-deploy":
          "npm install &amp;&amp; pm2 reload ecosystem.config.js --env preproduction &amp;&amp; pm2 save",
      },
    },
  };
  
  </code></pre>
  
  <p>pm2 version is 4.2.3</p>
  
  <p>Thx for your help</p>