Skip to content

Deploy failed: not a git repository (docs) #193

@drthoben

Description

@drthoben

When deploying my Node.js application using a local ecosystem file which is not part of the repository from an arbitrary folder on my server I'm getting the following error:

$ pm2 deploy ~/pm2/server.yaml staging
--> Deploying to staging environment
--> on host localhost
Not a git repository
To compare two paths outside a working tree:
usage: git diff [--no-index] <path> <path>

  commit or stash your changes before deploying

Deploy failed
Deploy failed with exit code: 1

I've discovered that if I cd into the repository folder first and then run the deploy script, deployment works as aspected. I did not expect this behaviour and could not anything related to it in the docs therefore it would be nice if would be mentioned in the docs somewhere.

Maybe it's even possible that the deploy script cd's into the repository folder first before pulling.

I'm using pm2 v4.5.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions