1

I use git reset --hard origin/master to pull the commits from bitbucket. I did this to avoid any kind of merge conflict since I am using a single branch and I want the code on production exactly similar as I committed. I don't expect nor do I want any changes.

1 Answers1

1

First, Git might not always be ideal as a release management tool (it remains a versioning control tool).
Plus, that makes one additional tool to install on a production environment, which is not directly needed to run the program.

For instance, a reset --hard would not cleanup private non-versioned file, that might need to be removed: see "How do I clear my local working directory in Git?".

Depending on the nature of what you are deploying, a git clean -d -x -f might be needed in addition of the reset.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I am using git as a versioning tool as well. It's very handy to control your code and detect bug sources. I am very cautious about my local repository and always keep it so that I don't have to worry about removing files on production. – bannedFromAskingQuestions Nov 30 '19 at 15:55