I have often been getting this error (or similar ones) for months now when I fetch.
How do I fix this? What causes this? Here is what is happening, step by step.
After a fetch:
error: cannot lock ref 'refs/remotes/origin/master': is at 1b8080a7ad8afa75a919feabeae31a8846763b73 but expected 67f1a4d428b7ab46a0fa62b4bb0d920592f920d9
From https://github.com/payne911/UdeM
! 67f1a4d..1b8080a master -> origin/master (unable to update local ref)
After clicking "Close" on first pop-up:
After clicking "Close" on the second pop up:
Pressing "Pull origin":
error: Your local changes to the following files would be overwritten by merge:
Trimestre_4/IFT3325_Teleinfo/devoirs/2/class_diag.png
Please commit your changes or stash them before you merge.
error: The following untracked working tree files would be overwritten by merge:
Trimestre_4/IFT3913_Qual_Metr/TP/3/~$apport.docx
Please move or remove them before you merge.
Aborting
So now the files were actually pulled, but not fully? And despite apparently not having been pulled since I can still click the "pull" button, they now appear as if they were modifications that I had done on this computer and that I need to commit them? Strange!
I commit and press "Pull Origin":
error: unable to unlink old 'Trimestre_4/IFT3325_Teleinfo/devoirs/2/rapport_tp2.docx': Invalid argument
That file wasn't even in the committed files! Though it was indeed opened. I closed it and pressed the button again:
Notice that I've successfully committed the changes which weren't changes from my part. Now I have a 'merge commit' set up. Then pressing "Push" gives no error and I'm back to normal.