git on windows shows modified files all the time, even for newly cloned repo

前端 未结 6 1888
你的背包
你的背包 2021-02-01 17:28

I am having issues with my git on a windows machine. I always have some git files that are modified in every repo, the files that show as modified are same.

If I clone

6条回答
  •  不思量自难忘°
    2021-02-01 17:59

    If using TortoiseGit with Cygwin git (not officially supported), several extra setup steps should be done:

    1. Select the [CYGWIN-INSTALL-PATH]\bin-folder as git.exe folder.

    2. Configure the HOME environment variable in Windows, so that Cygwin and TortoiseGit are using the same home directory and global git-config. Use the normal Windows notation here (e.g., C:\Users\USERNAME). By default, TortoiseGit uses the Windows home directory which is normally located under c:\Users and Cygwin uses its own home directories which are located under [CYGWIN-INSTALL-PATH]\home.

    3. Configure AutoCrLf, this is necessary as TortoiseGit and Cygwin Git have different defaults. The default in Cygwin Git is true.

    4. Go to TortoiseGit the section called Advanced Settings and set CygwinHack to true in order to activate cygwin workarounds.

    5. Reboot.

    Step #4 is crucial and resolved the problem for me.

    Reference (see Cygwin Git section): https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html

提交回复
热议问题