Uploaded image for project: 'Sourcetree For Mac'
  1. Sourcetree For Mac
  2. SRCTREE-4429

Push of Bitbucket repository with LFS fails if using system git-lfs

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • Next minor release
    • 2.3.2, 2.4
    • Bitbucket, Git
    • None
    • Mac OS X 10.11 (El Capitan)

    • Severity 2 - Major

      I have many git repositories hosted on Bitbucket, some of which also have LFS enabled.

      Also, in my system I have manually installed the latest version of git and git-lfs.

      SourceTree is configured to use those git and git-lfs installed in the system (and not the embedded version).

      In these circumstances, whenever I try to push a repository that has LFS content to be actually uploaded, the operation fails with the following message:

       

      git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree -c lfs.customtransfer.bitbucket-media-api.path=git-lfs-bitbucket-media-api push -v origin refs/heads/master:refs/heads/master

      Pushing to git@bitbucket.org:overloud/classics.git

      Failed to start custom transfer command "git-lfs-bitbucket-media-api" remote: exec: "git-lfs-bitbucket-media-api": executable file not found in $PATH

       

      However, if I open a terminal and issue a regular "git push", the operation completes successfully. 

      My suspect is that SourceTree sees a Bitbucket repository on the remote side and attempts to use the Bitbucket Media Adapter even if there is none installed in the system, hence the following part of the command line above causes it to fail:

      -c lfs.customtransfer.bitbucket-media-api.path=git-lfs-bitbucket-media-api

          Form Name

            [SRCTREE-4429] Push of Bitbucket repository with LFS fails if using system git-lfs

            Thanks for reporting this; this is down to the specific combination of using your own git-lfs install and Bitbucket without having also installed git-lfs-bitbucket-media-api yourself. We should be checking if we can see it before enabling it.

            There are 2 workaround while we fix this:

            1. Use the embedded git-lfs version (Preferences > Git > Reset to embedded Git LFS), or
            2. Install git-lfs-bitbucket-media-api in your system git folder, or somewhere else on the standard PATH (not somewhere that's only on the PATH because of your terminal bash_profile etc, SourceTree won't see that). You can get it from here: Bitbucket LFS Media Adapter

             

            Steve Streeting (Inactive) added a comment - - edited Thanks for reporting this; this is down to the specific combination of using your own git-lfs install and Bitbucket without having also installed git-lfs-bitbucket-media-api yourself. We should be checking if we can see it before enabling it. There are 2 workaround while we fix this: Use the embedded git-lfs version (Preferences > Git > Reset to embedded Git LFS), or Install git-lfs-bitbucket-media-api in your system git folder, or somewhere else on the standard PATH (not somewhere that's only on the PATH because of your terminal bash_profile etc, SourceTree won't see that). You can get it from here:  Bitbucket LFS Media Adapter  

              Unassigned Unassigned
              87a320161c53 yfede
              Affected customers:
              1 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: