I moved a couple of files that are in my project, but I did the move inside finder on my mac. I see that git source control treated the files as an add.
I haven't done a commit yet. git status shows the following:
Now when I do a version compare with these files in Xcode, the viewer has no history.
I looked at the accepted answer here and tried git log --follow ./pathtomynewfile. That gave no result.
Viewing changes in the version editor has become a valuable tool, and I would like to continue under these circumstances.
What can I do to tie to old version history to the new, relocated version?
Git won't necessarily show something as a "move" until after you've made a commit. This operation is not identified when the commit is done, but is done after the fact by tools (such as git log --follow). Basically, when Git tools see that a new file has appeared in the history, it looks around for other files that it might have come from (if the same or similar file was deleted in the same commit, then Git calls it a move).
Either use git mv, or git add the new file, and git rm the old file. Both add and rm need to be in the index when committing, otherwise git does not recognize it as a rename.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With