Home > Back-end >  Matlab showing missing as git status, but files are being managed fine by git
Matlab showing missing as git status, but files are being managed fine by git

Time:03-25

I have been managing version control via the command line on my project, but turned on the git integration in matlab to make it nice and easy to see what files have been altered.

Yesterday I had a change of heart over my naming conventions and capitalised the name of some files which were then successfully added and committed with git via the command line.

Now I have a little red icon next to my changed files (only these ones) which says missing when I hover over. I can still access and alter the files and do everything one would normally be able to do, but I cannot get rid of the red icons.

enter image description here

I've tried turning git integration off and on again in git, moving my .git folder away and back to the folder and opening matlab in between.

I can't seem to find a way to delete the source control settings for the project and re-initiate source control in its current status as I expect that would help.

edit - this is on windows 10 using matlab 2021b

CodePudding user response:

The error arose due to a conflict between the lowercase and uppercase files being recognised as two different files. This can be checked by running git ls-tree -r HEAD --name-only.

Because my last commit was only the name changes, I checked out the previous commit and used git mv <old name> <new name> to make sure that git knew the old file was being renamed and it wasn't a new file.

-- Edit --

The revision history now does not show when using just git log <file>, however adding the --follow tag, e.g. git log --follow <file name> as per TTT's suggestion shows the entire history as hoped for.

  • Related