git-mv 的目的是什么? [英] What's the purpose of git-mv?

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

问题描述

据我了解,Git 并不真正需要跟踪 file 重命名/移动/复制操作,那么真正的目的是什么git mv?手册页没有特别的描述性...

From what I understand, Git doesn't really need to track file rename/move/copy operations, so what's the real purpose of git mv? The man page isn't specially descriptive...

它过时了吗?是内部命令,普通用户不能使用吗?

Is it obsolete? Is it an internal command, not meant to be used by regular users?

推荐答案

git mv oldname newname

只是以下的简写:

mv oldname newname
git add newname
git rm oldname

即它会自动更新旧路径和新路径的索引.

i.e. it updates the index for both old and new paths automatically.

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

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