I have a giant directory which I need to import into git, and I am suffering the hell of line ending management.
Initially I need to just put everything inside the repo, having no time to deal with line endings. To get that, I added a .gitattributes file with * -text, but that doesn't solve the problem because there are lots of subdirectories containing modules with their own .gitattributes files and text=auto.
Is there any way to get all the files inside the repo with no more struggle?
The gitattributes documentation states:
When deciding what attributes are assigned to a path, Git consults:
$GIT_DIR/info/attributesfile (which has the highest precedence),.gitattributesfile in the same directory as the path in question, and its parent directories up to the toplevel of the work tree (the further the directory that contains.gitattributesis from the path in question, the lower its precedence).- Finally global and system-wide files are considered (they have the lowest precedence).
If you wish to affect only a single repository (i.e., to assign attributes to files that are particular to one user’s workflow for that repository), then attributes should be placed in the
$GIT_DIR/info/attributesfile.
So try and set your * -text directive in $GIT_DIR/info/attributes, at least for your initial add and commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With