0

If I use git mv then it records correctly the rename :

renamed: oldname -> newname 

But if I am just moving some files around and then git add they become unlinked:

deleted: oldname new file: newname 

Is there was a simple way to update the staged index, to change the deleted/new-file to a rename?

git version 2.25.0

9
  • What's your git version? Commented Feb 4, 2020 at 11:33
  • 1
    Not really. Git actually doesn't care. Commented Feb 4, 2020 at 11:33
  • 1
    Don't give them hope, @RomainValeri :-D For real, that's a user-level thing, not something that git tracks when committing. Commented Feb 4, 2020 at 11:34
  • as far as I know your have to git reset the change and then do git mv, if you really care about how things goes in git, but that's not much of different. Commented Feb 4, 2020 at 11:35
  • 1
    Can you provide a minimal reproducible example? A set of commands that show how mv created this state, including a git status at the end? Commented Feb 4, 2020 at 11:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.