Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to track a single file or a directory in git-lfs

herbst April 29, 2019

The context menu only has the option to add a complete file type. Online, I also only find ways to add complete file types to lfs.

From the look of it, it seems that it should be possible to use more specific patterns for folders / subfolders / filetypes, but I can't get that to work; lfs only ever works if it's really only a "*.mytype" declaration.

In some cases, I really want to track some specific folders and files in LFS while others of the same filetype should live in regular git land. Specifically, the ".asset" extension in Unity is used for a ton of things ranging from simple, text-readable ScriptableObjects (which should live in git land) to texture arrays with a size of several hundred MB (that's for LFS then).

Edit/Addendum: seems I can workaround by having a "fake" extension like ".lfs.asset", which I can manually add to the .gitattributes file. Also, I figured that sometimes (not always) directory pathes seem to work, as long as they don't contain any spaces and thus don't need any "" or '' in the .gitattributes file... but that's more of a workaround than a real solution, so please chime in if you know more!

1 answer

0 votes
minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2019

Hi

Your best bet is probably reaching out to the LFS community directly https://github.com/git-lfs/git-lfs?utm_source=gitlfs_site&utm_medium=source_link&utm_campaign=gitlfs

herbst April 30, 2019

Why is that? Just because I can work around some missing UI pieces / functionality in SourceTree doesn't mean that the UI is good...

 

At least, please consider this a feature request to provide more than just "track file type" in the SourceTree UI.

minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2019

Apologies I thought you meant that the directory patterns you manually added sometimes worked.

you can raise feature requests at https://jira.atlassian.com

herbst May 3, 2019

For reference, feature request is here:

https://jira.atlassian.com/browse/SRCTREEWIN-11719

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events