문제

Is there a nice way to call git mv on a file from within magit? I know it's possible to run any git command with :, but this won't autocomplete filenames.

도움이 되었습니까?

해결책 2

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top