When invoking git mv file1 file2
does it record the move internally (for history tracking in the log) or is it completely the same as invoking mv file1 file2
, git rm file1
and git add file2
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
git mv
is exactly the same as the three operations you listed. Although Git does not explicitly record the move in the repository, the move is detected later whenever you ask for history. For example, adding the --follow
switch to git log
automatically finds files that have been renamed.