Why doesn't git recognize that my file has been changed, therefore git add not working

前端 未结 24 2342
野趣味
野趣味 2020-12-04 08:07

I am trying to push my files to github using bash. They are already on there, and I am uploading a newer version with new lines and code, etc. But when I try git add<

24条回答
  •  清歌不尽
    2020-12-04 08:13

    We've had this happen on Windows when changing files by transferring differences via the WinMerge tool. Apparently WinMerge (at least the way it's configured on my computer) sometimes doesn't update the timestamps of files it changes.

    On Windows, git status, uses, among other things, a file's time stamp and changes in the file's size to determine whether or not a file has changed. So since the time stamp wasn't updated, it only had the file size to go by. Unfortunately the file in question was a simple version file where the content changed from 7.1.2 to 7.2.0. In other words, the file size also remained unchanged. Other files that were also changed by WinMerge and didn't have their time stamps updated but had a different size after the change were detected by git status just fine.

提交回复
热议问题