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:
Try to use
git fetch originandgit reset --hard whatever_deployment_branch_you_useinstead of pulling.That will make the repository not try to merge the code, so you will avoid conflicts on the server.