I'm fairly new to git and was wondering best practices when deploying to production? I have a master branch which always has the latest version of the code for production. When I goto production (for now I do it manually), I type git pull and get the latest. But it tries to merge the code, and sometimes it creates conflicts, etc. Is there a way for it to force it to take whatever is in the master branch as is?
I tried reading much on this including:
Best solutions to deploy from git to production?
http://posheika.net/?p=136
Try to use git fetch origin and git reset --hard whatever_deployment_branch_you_use instead of pulling.
That will make the repository not try to merge the code, so you will avoid conflicts on the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With