git deleted files by mistake? Who messed with the goods (file case modification)

1. Background

 

    A brother said today that I accidentally deleted his js file on git 

    

     I immediately felt unbelievable, as a programmer with 10 years of development experience, how could it be possible to do such a thing!!!!

 

     But my brother showed evidence 

 



 

 2. Check

 

As a newcomer to Socialism IV, I wouldn't do such a thing. Usually, I wouldn't delete someone else's file (if the code review wants to delete it, I'll definitely inform the other party), and I don't know which file is in the background management system. function of a js

 

 

 

I don't believe in evil

 

I have to look it up, look it up, why, I will show history based on the whole project

 

 

hey really found out, there is a delete record a few hours before my code version 



 

  

 

Oh, then I asked my brother, it turned out that he renamed the file name from update-item- baseInfo.js to   update-item- baseinfo.js , that is, changed from uppercase Info to lowercase info

 

 

3. Reason

 

Well, our development environment is currently the windows operating system, which is not case-sensitive, 

When git pull code, the original file will be deleted, but the name of the new file is the same as the original name for windows, so no new file will be created

 

And because I modified the author value in batches that day, this deleted record was ignored from the vast submission records and submitted naturally.

 

4. Summary

 

This event also points out:

 

  1. If it is a windows development environment, when renaming, do not simply modify the case.
  2. When submitting documents, you still need to be careful, and you may submit something that is not what you want to submit.

 

 refer to :

 

http://stackoverflow.com/questions/17683458/how-do-i-commit-case-sensitive-only-filename-changes-in-git

 

http://stackoverflow.com/questions/8481488/is-git-not-case-sensitive

 

http://stackoverflow.com/questions/10523849/changing-capitalization-of-filenames-in-git

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326197732&siteId=291194637