vicenteguerra / git-deploy

Php Script for Auto-Pull in server (Using WebHook from GitLab, GitHub and Bitbucket)
641 stars 236 forks source link

Would `git pull` works if history was changed using `git reset --hard`? #20

Closed tomekit closed 6 years ago

vicenteguerra commented 6 years ago

There should be no problem

tomekit commented 6 years ago

I've tested it. git pull will merge with your local repository. There is no guarantee that whatever you want to deploy will end up deployed correctly using git pull. I think mix of fetch, checkout and hard reset is much safer option. Please find this: https://gist.githubusercontent.com/thomasfr/9691385/raw/1d92aea9b3e12548ffebcfde18fd6a7c5327a810/post-receive