Skip to content

Add a way to automatically escape/quote filenames given to git lfs track #3506

@mitar

Description

@mitar

We use the following simple command to track all files larger than 100 KB in our repo:

$ find * -type f -size +100k -exec git lfs track '{}' +

The issue is that git lfs track in fact expects a git pattern and not filename as an argument. So if a filename contains special characters it can happen that this does not configure git lfs to really track a file. For example, if file has a filename foo[bar].jpg, calling git lfs track foo[bar].jpg will in fact not configure it to track that file.

I would suggest an argument is made to git lfs track to allow passing filenames and git lfs track would then make sure to properly escape/quote the filename before storing it into .gitattributes file. For example, something like git lfs track --filename or something like that.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions