How do you make Git ignore spaces and tabs?

前端 未结 3 1159
甜味超标
甜味超标 2020-12-31 00:38

I have a small scripting project that consists of five different source files in one directory called \"Droid XX-XX-XX\". Each time I created a new backup copy of the source

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-31 00:50

    1. You won't be able to make git ignore tabs/spaces as git creates a hash of each file and if the hash is different the file is considered different.

    2. Git treats trees (directories) the same as files; if their content changes then they are different tree's.

    I don't think these changes are anything to worry about however; they happen during any development. I think the best approach for you is to replay your development using git. In other words start with your initial version and then make the necessary changes (as you did originally) and git will remember what you are doing.

    Optional: If you want to record the date/time of the changes to be roughly those originally made, then you can use the --date command line option to git commit to tell git when these changes were made.

提交回复
热议问题