Beginner to learn git. Not understanding the differences between various ways of working. I hope you guys can help me compare.
Three places to put code: VPS, Coding.net hosting, local machine
There are three methods now:
VPS creates a working directory. On this machine, using git clone
directly on the working directory requires an extra step of git reset --hard master. This will not be automated
VPS has a repo, a working directory, and creates hooks. Using this machine, you can use git-hook
Create repo in coding.net, create webhook, and automatically git pull in vps.
This can use the provided webhook
This is the method I have learned so far. Are these three methods the most efficient?
Actually, what you want to ask is how to simply perform continuous integration/deployment, right? It is safer and simpler to host the code on a third party and use webhooks.
If your code needs to run unit test or build before deployment, you may need CI. There are many free CIs available, and most of them also support auto deployment. For example: travis-ci
Static files are served directly using coding pages. Nodejs uses PM2 for deployment.
Is there any necessary connection between learning Git and buying a VPS?