# Remote projects with GIt LFS

**URL:** https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612
**Category:** Fire
**Created:** [November 29, 2020, 3:32am UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612 "2020-11-29T03:32:04Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [November 29, 2020, 3:32am UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/1 "2020-11-29T03:32:04Z")

</div>

Hi,

Is this supported ?

I went to where ebuild has the repo and did git lfs install and it says

Updated git hooks.  
Git LFS initialized.

When I build I get

D: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -arch arm64 -o “/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/RealmiOSApplication-93A1D62F6E1CCA3EB4E730C04ECF7FEE2B46B664/Debug/Toffee-iOS/Device/arm64/RealmiOSApplication” “/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/RealmiOSApplication-93A1D62F6E1CCA3EB4E730C04ECF7FEE2B46B664/Debug/Toffee-iOS/Device/arm64/RealmiOSApplication.a” “/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/RealmiOSApplication-93A1D62F6E1CCA3EB4E730C04ECF7FEE2B46B664/Debug/Toffee-iOS/Device/arm64/RealmiOSApplication.o” -lSystem -lobjc -lToffee -lxml2 -L/Users/JohnMoshakis/Documents/Elements/References/Toffee/iOS -framework CloudKit -framework CoreFoundation -framework CoreGraphics -framework Foundation -framework Intents -framework Realm -framework UIKit -framework UserNotifications “-F/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Realm-9419A8B1244B42BDC9CB71A15D58B33F4F8380BA/Unknown/Toffee-iOS/Device” -ObjC -dynamic -demangle -force\_load /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang\_rt.ios.a -dead\_strip -rpath @executable\_path -rpath @executable\_path/Frameworks -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks  
E: ld: warning: ignoring file /Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Realm-9419A8B1244B42BDC9CB71A15D58B33F4F8380BA/Unknown/Toffee-iOS/Device/Realm.framework/Realm, building for iOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F )  
\> ld: Undefined symbols for architecture arm64:  
\> ld: “_OBJC\_CLASS_$\_RLMRealm”, referenced from:  
\> ld: objc-class-ref in RealmiOSApplication.a(MainViewController-27a04cc4d23404329c3e844021c9c123.o)  
\> ld: “_OBJC\_CLASS_$\_RLMRealmConfiguration”, referenced from:  
\> ld: objc-class-ref in RealmiOSApplication.a(AppDelegate-d556fda9a4046af5a037b68ec31609be.o)  
\> ld: “_OBJC\_CLASS_$\_RLMObject”, referenced from:  
\> ld: _OBJC\_CLASS_$\_DataObject in RealmiOSApplication.a(DataObject-c280a8dbcdc876442e3ba2759dcbd565.o)  
\> ld: “_OBJC\_METACLASS_$\_RLMObject”, referenced from:  
\> ld: _OBJC\_METACLASS_$\_DataObject in RealmiOSApplication.a(DataObject-c280a8dbcdc876442e3ba2759dcbd565.o)  
E: ld: symbol(s) not found for architecture arm64

Realm is the file that I used with lfs.

Cheers,  
John

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [November 29, 2020, 3:18pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/2 "2020-11-29T15:18:54Z")

</div>

> [@JohnMoshakis](#):
>
> E: ld: warning: ignoring file /Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Realm-9419A8B1244B42BDC9CB71A15D58B33F4F8380BA/Unknown/Toffee-iOS/Device/Realm.framework/Realm, building for iOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F )

Sounds like this is not a valid binary. what does `file` say?

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 6, 2020, 6:09am UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/3 "2020-12-06T06:09:09Z")

</div>

The file starts off as a pointer

I was able to get it working by going into the ebuild git repo and doing “git lfs install”

> **[Git LFS - large file storage | Atlassian Git Tutorial](https://www.atlassian.com/git/tutorials/git-lfs#pulling-and-checking-out)**
>
> Git LFS is a Git extension that improves handling of large files by lazily downloading the needed versions during checkout, rather than during clone/fetch.

Reading that link seems to imply once it’s turned on it should work using regular commands.

It didn’t seem to so I did a “git lfs pull” and then the file changed from the reference to the actual one.

I don’t suppose it would be possible to support this from within Fire ?

I have a git repo with all my import projects and the associated framework files. Im using remote references for this. It seemed to me like a great idea to share import projects between ios apps but I didnt realize that git has a 100mb file limit and one of the files in the latest realm framework is greater than this.

Cheers,  
John

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 6, 2020, 12:46pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/4 "2020-12-06T12:46:27Z")

</div>

> [@JohnMoshakis](#):
>
> I don’t suppose it would be possible to support this from within Fire ?

Sure. I’m not very familiar with LFS support int git. is it safe to just always do a “`git lfs pull`” (even if its not installed), or else, is there a clean way to find _if_ its necessary?

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 7, 2020, 3:55am UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/5 "2020-12-07T03:55:20Z")

</div>

You need to install it first. There is a lfs folder under the .git folder, I was wondering if that could be used to determine if its installed ?

Im still not entirely sure if you need the extra lfs commands or not. I haven’t been able to get it working without doing an extra git lfs pull.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 8, 2020, 12:13pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/6 "2020-12-08T12:13:50Z")

</div>

I’ll have a look.

do you have a public repo with a remote project that uses LFS that I could use to test against?

—marc

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 8, 2020, 1:47pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/7 "2020-12-08T13:47:25Z")

</div>

> **[mosh/ImportSolution](https://github.com/mosh/ImportSolution)**
>
> Projects to create fx files. Contribute to mosh/ImportSolution development by creating an account on GitHub.

> <https://github.com/mosh/ImportSolution/blob/master/Realm/iOS%20Simulator/Realm.framework/Realm>

  
and  

> <https://github.com/mosh/ImportSolution/blob/master/Realm/iOS/Realm.framework/Realm>

  
are the large files.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 8, 2020, 2:10pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/8 "2020-12-08T14:10:02Z")

</div>

If I add this remote project ref to an iOS project, should it fail to link, out of the box? it doesn’t, here…

that said, the file isn not the proper binary:

```auto
➜ Cherry:~/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.mosh.ImportSolution/Realm/iOS/Realm.framework git:(master) # file Realm
Realm: ASCII text
➜ Cherry:~/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.mosh.ImportSolution/Realm/iOS/Realm.framework git:(master) # cat Realm 
version https://git-lfs.github.com/spec/v1
oid sha256:a45609d916076c16687afe4214914020f710e08525ea788f5900b9dd461e2b4a
size 119156892
➜ Cherry:~/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.mosh.ImportSolution/Realm/iOS/Realm.framework git:(master) # 

```

however, `git ofd install` does not seem to be a valid command; I assume I’d need to install this [https://git-lfs.github.com](https://git-lfs.github.com) first? I’m hesitant to do this right now, as I understand it could potentially affect all git repros (also, it uses brew, which isn’t supported on Apple Silicon yet)…

What I can do is implement the following changes “blind”, assuming you can confirm the exact commands/folders:

- after checkout, if `./git/lfs` exists as a folder on disk, I will run `git lfs pull` after each regular pull.

With the, I assume an initial build (ie a clean checkout) would still fail the first time, until there user activates LFS for the repo manually (no way to detect that automatically, really?), but once it’s done, subsequent builds should pull correctly.

how does that sound?

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 8, 2020, 8:17pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/9 "2020-12-08T20:17:39Z")

</div>

> [@mh](#):
>
> `git ofd install`

Its git lfs install and yes you need to install lfs from [https://git-lfs.github.com](https://git-lfs.github.com/)

I think when you initially clone you would need to call git lfs install, and then each time you pull do a git lfs pull.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 10, 2020, 11:57am UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/10 "2020-12-10T11:57:09Z")

</div>

> [@JohnMoshakis](#):
>
> I think when you initially clone you would need to call git lfs install,

But how would I know when to do that?

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 10, 2020, 12:24pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/11 "2020-12-10T12:24:11Z")

</div>

Yes thats true. Would it be possible to add an attribute ?

```
<RemoteProjectReference Include="github.com/Mosh/iOSApp.Core/libiOSApp.Core.elements:*">
  <Private>True</Private>
  <lfs>True</lfs>
</RemoteProjectReference>

```

Then you also wouldnt need to check for the lfs folder

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 10, 2020, 12:35pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/12 "2020-12-10T12:35:43Z")

</div>

> [@JohnMoshakis](#):
>
> Yes thats true. Would it be possible to add an attribute ?

I can do that. SO if thats present, I do `lsf install` on clone and `lfs pull` on pull. Will add for tomorrow (blind), let me know how it goes,.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 10, 2020, 12:47pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/13 "2020-12-10T12:47:29Z")

</div>

Done. the setting will be `<LFS>True</LFS>`, upper-case.

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 10, 2020, 1:11pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/14 "2020-12-10T13:11:29Z")

</div>

I just need to download an upcoming zip file ?

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 10, 2020, 1:11pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/15 "2020-12-10T13:11:59Z")

</div>

It’s merged now, so the next build should have this, yes.

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 11, 2020, 3:36am UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/16 "2020-12-11T03:36:33Z")

</div>

If I delete the repo and build I get this

> git: Updating files: 100% (2795/2795), done.  
> git: Already on ‘master’  
> git: Your branch is up to date with ‘origin/master’.  
> git: WARNING: error running /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git ‘config’ ‘–global’ ‘–replace-all’ ‘filter.lfs.clean’ ‘git-lfs clean – %f’: ‘fatal: $HOME not set’ ‘exit status 128’  
> git: Run `git lfs install --force` to reset git config.  
> E: There was a problem obtaining remote project ‘[github.com/mosh/ImportSolution/Realm.elements:\*](http://github.com/mosh/ImportSolution/Realm.elements:*)’ referenced from ‘RealmiOSApplication’.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 11, 2020, 12:10pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/17 "2020-12-11T12:10:09Z")

</div>

> [@JohnMoshakis](#):
>
> git: WARNING: error running /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git ‘config’ ‘–global’ ‘–replace-all’ ‘filter.lfs.clean’ ‘git-lfs clean – %f’: ‘fatal: $HOME not set’ ‘exit status 128’  
> git: Run `git lfs install --force` to reset git config.

Ok, what does that mean for us, should I always use `--force`, jic?

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 11, 2020, 3:49pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/18 "2020-12-11T15:49:26Z")

</div>

I don’t think so.

Previously I deleted the folder and did a build. I then went into the folder and did a git lfs install, followed by a git lfs pull. After that a build would be successful.

Are you running any lfs commands before the lfs install ?

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 11, 2020, 4:30pm UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/19 "2020-12-11T16:30:36Z")

</div>

> [@JohnMoshakis](#):
>
> Are you running any lfs commands before the lfs install ?

No.

```auto
        if lFolder.FolderExists then begin
          if Path.Combine(lFolder, ".git").FolderExists then begin
            aContext.Logger.LogDetail($"Pulling {aUrl} to {lFolder}");
            if not RunGit(aContext, ["checkout", aBranch], lFolder) then exit false;
            if not RunGit(aContext, ["pull"], lFolder) then begin
              aContext.Logger.Warning("Pull for git repository {0} failed.", aUrl);
              if aForcePull then
                exit false;
            end;
            if aLFS then
              if not RunGit(aContext, ["lfs", "pull"], lFolder) then exit false;
          end
          else begin
            aContext.Logger.Error($"Folder '{lFolder}' already exists, but is not a git repository.");
            exit false;
          end;
        end
        else begin
          aContext.Logger.LogDetail($"Cloning {aUrl} to {lFolder}");
          if not RunGit(aContext, ["clone", aUrl, lFolder]) then exit false;
          if not RunGit(aContext, ["checkout", aBranch], lFolder) then exit false;
          if aLFS then begin
            if not RunGit(aContext, ["lfs", "install", "--force"], lFolder) then exit false; // --force added now
            if not RunGit(aContext, ["lfs", "pull"], lFolder) then exit false;
          end;
        end;

```

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 12, 2020, 1:14am UTC](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612/20 "2020-12-12T01:14:05Z")

</div>

Where is filter.lfs.clean’ ‘git-lfs clean coming from ?

[Next page](https://talk.remobjects.com/t/remote-projects-with-git-lfs/23612.md?page=2)
