Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Git LFS and Push

On Sat, May 21, 2016 at 7:30 AM, Jacob Wang <jatcwang@xxxxxxxxx> wrote:
Hi,

I am currently writing an application which utilizes JGit and its LFS capabilities.

Most actions related to LFS seems to work, like AddCommand (runs through the LFS filter) and Clone/Checkout.

However running Push doesn't seem to push the LFS object into the LFS storage.

My .gitattributes file:

===

* filter=lfs diff=lfs merge=lfs -text
.gitattributes -filter -text -diff -merge
_content -filter -text -diff -merge

===

and here's my .git/config

===

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = "" href="https://jatcwang1.visualstudio.com/_git/lfstest" rel="noreferrer" target="_blank">https://jatcwang1.visualstudio.com/_git/lfstest
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[lfs "https://jatcwang1.visualstudio.com/_git/lfstest.git/info/lfs"]
    access = basic

===

On a side note, I have git-lfs installed, but I removed hooks/pre-push (which runs git-lfs for uploading files) before I ran PushCommand, to test that it successfully uploads the file to the large file storage.

What am I missing to get file upload on Push to work? Thanks

don't remove the pre-push hook :-) 

JGit still depends on git-lfs, it must be installed, configured and reachable in the PATH seen by JGit.
We now have support for gitattributes and JGit learned to run external clean and smudge filters
and how to trigger the pre-push hook.

We are working on a built-in implementation of git-lfs in JGit but that's not yet ready, see [1].


-Matthias

Back to the top