Git has the --force flag in many operations, but when I use them, I feel a little strange. Like ignoring warning messages in my code.
For example, I just wanted to disable the file and did the following:
git rm --cached myfile.ext
Git complained about the error:
the following file contains content other than the file and HEAD
I really don't care about this error and it doesn't seem to be a problem. I just want to leave my code as it is, but disable the file. The --force flag just solved this problem.
My question is about best practices, since I could not find any information about this issue. should i use force flags in git commands or is it bad practice >?
UPDATE
I found this question of mine and had some idea that mine is useful to everyone who is interested.
force flag is similar to the yes/no view of the git dialog box (or any similar software). For example, when doing something that could lead to a crash or damage, we usually get a yes/no dialog. So the git equivalent of yes is equal to --force , which answers my question that using the force flag is a normal procedure.
git
lukas.pukenis
source share