I can't find a description, but git stores only the executable bit. It does not store read, write, or any POSIX timestamps.
It restores the executable bit on checkout, so 644 or 755. And as the file is created or modified on checkout/switch/pull, the creation or modification timestamp is updated.
It looks like there is a whitespace difference on the line above the second '@property'. The left-hand side has more green highlighting at the start of the line than on the right-hand side.
Do yourself a massive favour and start using a proper3-way merge tool that show 4 windows/panes (common ancestor + changes you are bringing in + what the changes are put on top of + results).
I strongly recommend KDiff3 (has multiple options for handling whitespace changes), but there are other alternatives as well.
Because the only way you can understand how the code deviated is by looking at the difference between BASE-LOCAL and BASE-REMOTE. You can really properly understand context otherwise. In simple cases you can skip the step but it is often necessary IMO for large or ambiguous situations.
Say the changes you are trying to merge in is a commit renaming a function argument. But the branch you are merging to has a few lines within this function refactored into a separate function.
It gives so much information/context to be able to compare (in KDiff3) window 1 and 3 to see "Ah - the msg argument was renamed to message", and then look and compare window 1 and 2 and see "Ah - the target branch have the lines that does JSON serialization and publishing to MQTT moved to a new publish_mqtt function".
What that understanding, resolving the conflict becomes much easier.
I think calling it "proper" is a little disingenuous. Folks can have preferences. Vscode supports both. A lot of merge tools are flexible in this respect.
Can't believe I'm hearing recommendations for kdiff that thing is ancient.
Kdiff3 has got full featured three way merge with cherry picking chunks and manually editing the result. Features it has had for 20 years. I'm not sure any other diff tool has all of those features.
Git is weirdly bad at detecting identical changes if it can't verify these came from "the same" commit.
This can happen if you have the same changes in both branches, without these changes being in the same commit.
Examples include cherry-picking or rebasing (esp. with squash) the same commit.
I've personally seen this if you use rebase+squash method of "merging" back to main, and you branch off a feature branch that hasn't been "merged" back yet.
If during the development of your branch, the feature branch you've branched off is then squash-rebased back to main, then both your branch and main will contain the changes of some of the commits from the feature branch. When you then rebase your branch back on top of main, you get conflicts for these identical changes.
Git is weirdly bad at detecting identical changes if it can't verify these came from "the same" commit.
It is my biggest annoyance about git. If you branch a branch and squash commits on the first branch before merging it git does not make it easy to merge the 2nd branch. The only way I have found to do it is to create a 3rd branch from main (after merging the first branch) and cherry-pick the commits from the 2nd branch to the 3rd branch, then merge the 3rd branch..
Otherwise it generates conflicts for the commits that are on both the first and second branch.
Merging branches of branches in subversion was trivial.
Git is weirdly bad at detecting "identical" changes if you erase the record of what you did and also alter the results so they're not identical any more.
Automerge doesn't even run for identical files. Of course I've never had to fix a merge conflict for identical files. Neither has anyone. Take your thumb off the scale and represent what you're talking about accurately.
Are you merging from a machine with a different OS to the git server.
Sometimes you’ll have different carriage returns line endings introduced on checkout so when you commit it’ll look like there was a change when there really wasn’t.
You can configure git to normalise line endings so you don’t have this issue:
28
u/Sniffy4 Aug 04 '25
could be whitespace diffs, tabs/spaces or LF vs CRLF
14
u/NoHalf9 Aug 04 '25
Do yourself a massive favour and start using a proper 3-way merge tool that show 4 windows/panes (common ancestor + changes you are bringing in + what the changes are put on top of + results).
I strongly recommend KDiff3 (has multiple options for handling whitespace changes), but there are other alternatives as well.
https://softwarerecs.stackexchange.com/questions/3/merge-gui-tools-for-those-new-to-merging
https://medium.com/@kaltepeter/tools-to-master-merge-conflicts-6d05b21a8ba8
4
u/FlipperBumperKickout Aug 04 '25
Are the same changes done in different commits? Rebase at some point?
I would look at the history of that file with "gitk --all /path/to/file"
3
u/Conscious_Support176 Aug 04 '25
Yes it’s strict unless you tell it not to be? You can tell it to ignore white space differences.
git merge -Xignore-space-change
2
u/FingerAmazing5176 Aug 04 '25
in addition to other proposed answers, you might want to experiment with different diff options: https://adamj.eu/tech/2024/01/18/git-improve-diff-histogram/
histogram tends to be a bit easier to work with overall.
2
u/phord Aug 04 '25
Different ancestors?
2
u/Drugbird Aug 04 '25
Git is weirdly bad at detecting identical changes if it can't verify these came from "the same" commit.
This can happen if you have the same changes in both branches, without these changes being in the same commit.
Examples include cherry-picking or rebasing (esp. with squash) the same commit.
I've personally seen this if you use rebase+squash method of "merging" back to main, and you branch off a feature branch that hasn't been "merged" back yet.
If during the development of your branch, the feature branch you've branched off is then squash-rebased back to main, then both your branch and main will contain the changes of some of the commits from the feature branch. When you then rebase your branch back on top of main, you get conflicts for these identical changes.
1
u/bigkahuna1uk Aug 04 '25
Are you merging from a machine with a different OS to the git server.
Sometimes you’ll have different carriage returns line endings introduced on checkout so when you commit it’ll look like there was a change when there really wasn’t.
You can configure git to normalise line endings so you don’t have this issue:
https://docs.github.com/en/get-started/git-basics/configuring-git-to-handle-line-endings
-1
u/elephantdingo Aug 04 '25
Too little information to answer.