Why does `git checkout <branch> <file>` perform the change?
If I start with a clean working tree and run git checkout <branch> <file>where it <branch>has a different version of this file, I get a phased, not unstated change.
What is the reason for this? Is it just for consistency with other commands like git mvyou would expect to generate changes? Is this convenient when used git checkoutto resolve merge conflicts? Or is there another justification?
It seems a little strange to me, since just using it git checkout <branch> <file>does not give any indication about whether I plan to make a change.
, Git .
Git - , , - . ( ) : , , , 1 - . Git . 2 " " . .
git checkout , , . , , , . , , , , . , , git checkout ... . .
, . F , 1 (), 2 (--ours) 3 (--theirs) -, , , . git checkout - commit-or-tree, Git , . , !
1 - . ElpieKay , Git , , , / blob. , stat , Git .
2 , git read-tree, , git checkout-index . Git , git-checkout, C- , git-read-tree. ( , git.)