Git warning of file overwriting due to (supposedly) untracked files

前端 未结 4 1247
南旧
南旧 2021-01-18 21:38

Attempting to pull from git repo, but getting the following output. I think these files are tracked (As they should be), but its indicating that they are not. They are not i

4条回答
  •  悲&欢浪女
    2021-01-18 21:58

    So it seems a scenario for this problem is when a file has been deleted and you still have a copy of it. For some reason, git fails to understand it.

    None of these suggestions worked for me.

    Finally I could fix it by git rm filename, git commit -m "temporary commit", then git pull --rebase.

    At this point, git complained again and then I had to add the file to be tracked by git add filename, git commit -m "temporary commit2", then git pull --rebase.

    Then everything went well. And I do not see my temporary commits as they cancel out each other.

提交回复
热议问题