When I run sf project deploy preview it shows particular files as conflicted. However, when I run SFDX: Diff File Against Org, it shows as identical.
What does it mean to have a conflict when attempting to deploy? And how does one resolve it?
Source tracking works by grabbing the last modified time stamp from the file when you do a pull or push, and also tracks the timestamps of the local files. If the last known time stamp on the server is different, then we know the server copy has been modified. Similarly, if the local time stamp has been updated, both sf and git will observe that the timestamps don't match, and show differences, even if there are no actual changes to the file. If both timestamps are modified from their original values, we have a conflict.
It's a really simple algorithm, which is why it doesn't take long to figure out if there's a conflict. However, this also means that it's not terribly accurate, because just doing something like touch force-app/default/main/classes/Utils.cls will make sf think the file's been modified (touch is a utility that updates the timestamp without modifying a file).` Similarly, using something like VS Code, simply pressing Ctrl+S to save a file triggers the file save handlers, such as automatically formatting the document.
In summary, simply changing the file's last modified timestamp locally and making a trivial edit on the server is enough to cause a conflict warning. Also, note that if you use the deploy method instead of push, or if you're working in multiple directories that point to the same org, etc, you can trigger a conflict warning without any actual content change. As you've noted, "use with extreme caution" is warranted. This answer is more an explanation as to why and how such events can occur.
--ignore-conflicts flag, but it doesn't ignore, it actually forces them to deploy
sf project reset trackingdocumentation to see if that may be appropriate.Use with extreme caution.on the first line :)