Unitech / pm2-deploy

Deploy part of PM2
http://pm2.keymetrics.io/docs/usage/deployment/
MIT License
178 stars 71 forks source link

Can not fetch the lastest commit with git 1.8.3.1 #143

Closed Program-Monkey closed 7 years ago

Program-Monkey commented 7 years ago

I think this problem can be solved with pm2-deploy , check the git version before fetch the commit , if git version is < 1.8.3.x :

  1. use older version (0.2.0) shell : git fetch --all

  2. use refspec : : shell : git fetch $ref (like origin test) : $$ref(like refs/remotes/origin/master) --depth=5 --tags

oaleynik commented 7 years ago

The problem is that during setup stage pm2-deploy doesn't use --no-single-branch flag while cloning git repo. In newer git versions without that flag only one branch which is referenced by --branch argument will be fetched.

Also this makes impossible to have different branches deployed because there will not be any other ref except the one from the --branch argument.

Program-Monkey commented 7 years ago

In newer git version is ok. The problem just on server which use git-1.8.3.1 . I see lots of yum source was used git-1.8.3.1 (つ#_#つ)

Program-Monkey commented 7 years ago

This is just a suggestion, in order to be compatible with git old version