git mv记录移动? [英] git mv records move?

查看:130
本文介绍了git mv记录移动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当调用 git mv file1 file2 时,它会在内部记录移动(用于日志中的历史记录)还是与调用完全相同mv file1 file2 git rm file1 git add file2

解决方案

git mv 与您列出的三项操作完全相同。虽然Git没有明确记录存储库中的移动,但稍后您在查询历史记录时都会检测到该移动。例如,添加 - 关注切换至 git log 会自动查找已重命名的文件。


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?

解决方案

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.

这篇关于git mv记录移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆