How to use git mv from magit?

。_饼干妹妹 提交于 2019-12-04 22:25:01

I'm not sure offhand if there's a direct way, but...

Given that a mv is the same thing as a rm plus an add, you can just rename the file normally (e.g. in dired), and then stage both of the consequent changes -- a deleted file and a new file.

Git should figure it out.

Edit:

M-x vc-rename-file ?

For reference at least in current verion of magit there is magit-file-rename which can be invoked by R.

I use dired for this. C-x d when the file is open, then press ! on the file to run git mv ? newpath command with the file as the ? argument.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!