Skip to content

git lfs blows up when a space is present in filename #298

Closed

Description

@kernelsmith

if I

git lfs track "file/with/a space in it"

all goes well until I do a push or similar, then I get

file/with/a is not a valid attribute name: .gitattributes:1

and manually adding quotes around the file name in .gitattributes doesn't help. This is pretty brutal. Is there a config option or somesuch that enables this behavior. I don't personally use spaces in file names, but some of my users do.

Activity

  1. technoweenie commented on May 11, 2015

    @technoweenie
    Contributor

    Try editing your .gitattributes, using [[:space:]] in place of actual spaces.

    file/with/a[[:space:]]space[[:space:]]in[[:space:]]it filter=lfs diff=lfs merge=lfs -crlf
    

    This seems to be a limitation in the gitattributes file. But if [[:space:]] works, we can have git lfs track insert it in place of spaces pretty easily.

  2. kernelsmith commented on Jun 3, 2015

    @kernelsmith
    Author

    It's probably clear at this point that [[:space]] did fix the problem. Thanks for that as well as the PR to fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions