Git-LFS problems on MAC

Hi there,

a friend of mine and I are trying to set up Git-lfs to work on a project more efficiently.
However, he has a Macbook and since we are by far no professionals in terms of Git, we are getting really annoying errors. We only used the commands: brew git lfs install , git install and sudo git install --system. Maybe we have to add something more to git? Everything is fine on my windows computer, but it seems like UE4 can’t find any git-lfs commands, although it has been installed. I’ve attached an Image with the error messages showing up. I hope you guys can help me out with this.

Thank you in advance for your help! :slight_smile:

I think it has already been reported not working under Mac.

Sorry, I don’t have a Mac nor anyone else have one around me :frowning:

ok, hopefully they will fix this issue, since Perforce somehow doesn’t work in our local network ^^
I couldn’t find any similar topic, so i thought this would be an uncommon problem.

Well, I am the developer maintaining the Git plugin…

Can you check ‘git lfs version’ on your command line?
And then git lfs ls-files on the root of the project repository?

Sure, i’ve added 2 Images from my windows computer and 2 images from the macbook of my friend.

214676-macbook-git-lfs-version.png

214678-windows-git-lfs-version.jpg

Thanks, really weird, seems like an environment issue: while in the command line, paths dans other env variables may be set in a way that make it works, while inside UE they are missing.

I should try under Linux, perhaps the issue is the same and so the solution could work

There is one more issue i’ve encountered while using git ue4 with my windows pc (don’t know if this is already reported):

sometimes when i wanted to rename, or delete an object, the git plugin wouldn’t let me.
When i renamed an asset, for example from ball_M to newBall_M, then i would have 2 assets in that folder, one called ball_M and newBall_M.
Assets which i wanted to be deleted couldn’t be deleted, unless i commited them.

wish you best of luck in fixing :slight_smile:

Its not the Git plugin fault; the Engine create a “Redirector” (think of a shortcut/a symlink) from the old name/location to it’s new name. This can be useful is someone else is working on a new asset pointing to the old name.

You have to use the command “Fixup redirectors in folder”. Use right click context menu on any folder of the Content Browser.

So the answer it that this is a known issue, that Git LFS is not working in UE4.

As I am the sole developer working on the Git Plugin, and have no access to a Mac, it is not going to change soon.
I’ll try on Linux to see if there is the same issue here, so perhaps I could get a better idea of the situation.

Sorry for the inconvenience!

okay, thank you for your help!

Wish you best of luck in fixing this.

Please try this.

  1. create wrapper script (e.g. ~/bin/ue4-git )

    #!/bin/sh
    

    GIT_PATH="/usr/local/bin"
    GIT_LFS_PATH="/usr/local/bin"
    /usr/bin/env PATH="${GIT_PATH}:${GIT_LFS_PATH}:${PATH}" “${GIT_PATH}/git” “$@”

  2. append execute attribute to wrapper script

     $ chmod +x ~/bin/ue4-git
    
  3. set wrapper script path to Git Path on Git plugin

The Cocoa application does not inherit shell environment variables.
Therefore, supplement PATH with a wrapper script.

since i don’t know much about git i have some questions:

  1. should we create a warpper script called ue4-git ?
  2. does the script has to have any specific file format or just a .txt file?
  3. step number 2 is taking place inside bash right?
  4. so instead of telling ue4 where git is, i tell ue4 where the script is?

sorry for these noob questions, but thank you alot for your help :slight_smile:

  1. should we create a warpper script called ue4-git ?

Yes.

  1. does the script has to have any specific file format or just a .txt file?

The script is a text file and can be named arbitrarily.

  1. step number 2 is taking place inside bash right?

Yes. Please open the Terminal.app and execute this command.

  1. so instead of telling ue4 where git is, i tell ue4 where the script is?

Yes

We did every single step in the way you descriped it.
Sadly we still get an error message saying: “Source Control: Failed to enable Git source control. You need to install Git and specify a valid path to git executable”.

Process:

  • We put a file called ue4-git.rtf inside /usr/local/bin/ where git and git-lfs files are stored.
  • We deleted .rtf from the document, else it wouldn’t be converted into an exec file.
  • We run chmod +x etc. on the text document, which converted it into a script.
  • We added the converted script as a Git Path in ue4

I guess we have done something wrong?

Perhaps, the wrapper script does not work well because you saved it in rtf format.
If you are using TextEdit please refer to here and save it as plain text.

And I made a checklist, so please refer to this as well.

  1. Print working directory (in capture it is /Users/shiena)
  2. Print wrapper script (in capture the file name is ue4-git)
  3. Print wrapper script attributes. (-rw-r–r-- is not executable)
  4. Append executable attribute to wrapper script.
  5. One more view wrapper script attributes(-rwxr-xr-x is executable.)
  6. Execute wrapper script with version argument.
  7. Execute git with version argument. (It should be the same result as #6)

Thank you very much, it helped a lot!!!
My friend can commit now.

THANKS A LOT!