Search code examples
gitmergegitattributes

How do I define a .gitattributes rule for a file with spaces in it?


I've read the documentation on .gitattributes and searched Stack Overflow for a simple answer to this question, but so far haven't found it. I have a file with spaces in it like so.

Reserved\ Slots.txt merge=mergeslots

I have also tried to use quotes instead of escaping the space.

"Reserved Slots.txt" merge=mergeslots

How do I use a custom merge driver for a file with spaces in it?


Solution

  • According to Whitespace in .gitattributes patterns use

    [[:space:]]
    # as in
    has[[:space:]]spaces