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

SourceTree: Git extensions (like LFS) and System Git

Stefan Baumgartner June 1, 2015

Hello everyone!

I'm kinda lost here so I hope you can help me. We use the new Git LFS from GitHub on our servers, and want our designers to use it via the SourceTree app. The Git LFS extension is pretty need because you just need to activate it once, and then you can use your standard git commands (like add/push/commit) without any special extras, LFS just knows to put it somewhere else.

Now I thought that with SourceTree (and the switch to use System Git) this might be possible, too, since SourceTree would just act as some sort of wrapper to the original commands. Sadly, it doesn't work: 

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree add -f -- "Screen Shot 2015-06-01 at 15.29.57.png" 
git: 'lfs' is not a git command. See 'git --help'.
 
Did you mean this?
 flow
error: copy-fd: write returned Broken pipe
error: cannot feed the input to external filter git lfs clean %f
error: external filter git lfs clean %f failed 1
error: external filter git lfs clean %f failed
fatal: Screen Shot 2015-06-01 at 15.29.57.png: clean filter 'lfs' failed
Completed with errors, see above

 

Do I miss something? Should I run it as a different user maybe? If so, how can I do it.

4 answers

1 accepted

1 vote
Answer accepted
Stefan Baumgartner June 19, 2015

Okay, I found the problem. I am using System Git, yes, but I don't have access to everything in PATH. SourceTree looks for the extensions in the same folder where Git is, so I just have to link to the git-lfs extension, so it seems to be in the same folder as System Git.

 

    ln -s /usr/local/bin/git-lfs /usr/bin/git-lfs

David Bernard October 2, 2015

But this symlink is only a workaround, because everyone will need to re-create it every time they install a new Mac OS X version (like El Capitan :P).

Georg Schmidt October 4, 2015

:-) in some way you are right... but I just found out that it seem to be not possible to create a symlink like "ln -s /usr/local/bin/git-lfs /usr/bin/git-lfs" in "El Capitan". There seem to be restrictions even to root. Thanks. Your post somehow helped.

David Bernard October 5, 2015

Yeah I found out after I commented. So I created an issue about that: https://jira.atlassian.com/browse/SRCTREE-3174

Shawn Halwes October 28, 2015

In Windows I just copied the git-lfs.exe file to the bin directory that the GitHub system git.exe is in and the errors generated by SourceTree go away.

2 votes
David Bernard October 7, 2015

On OS X 10.11 (El Capitan), the /usr/bin folder is now restricted, so the workaround now is to have everything inside /usr/local/bin, and symlink the "git" binary (not git-lfs) there:

ln -s /usr/bin/git /usr/local/bin/git

And then in SourceTree choose the Use System Git from /usr/local/bin.

Joseph Humfrey December 10, 2015

Thanks, this one worked for me!

0 votes
Stefan Baumgartner June 1, 2015

Hey Seth, thanks for looking into it. We are on Mac, all of us. When I run it via the command line it works like a charm, that's the output: ➜ marketing-lfs git:(master) git push origin master (0 of 1 files) 0 B / 386.41 KB 0.00 % Username for 'http://git-lfs-endpoint';;;: something Password for 'http://git-lfs-endpoint;: (1 of 1 files) 386.41 KB / 386.41 KB 100.00 % 4s Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 385 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) To https://git-endpoint e74defe..25d7f77 master -> master One thing that popped into my mind is that I'm using zsh. Might that be a problem? Best, Stefan

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 1, 2015

What happens if you run those git commands from the command line by hand? Are you on Mac or Windows?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events