Search code examples
gitsubgit

How to skip generating .gitattribute file?


I am required to not to include .gitattribute. but subgit add it to the repository. could I know how can I stop subgit adding .gitattribute file?


Solution

  • SubGit adds .gitattributes files in two cases: when translate.eols is set to 'true' and when translate.otherProperties is set to 'true'. The latter is 'false' by default, so I believe the .gitattribiutes file is being created because the 'eols' is 'true'. To prevent creating .gitattribiutes file the settings should be set to 'false' in SubGit configuration file:

    [translate]
         eols = false
         otherProperties = false
    

    The problem here is that the settings can't be changed on the fly, it must be set prior to the initial translation. So if the mirror has already been established, you would need to rebuild it to apply these settings:

    subgit install --rebuild
    

    After that the files should not appear any more.