Installing git-lfs

This page contains out of date information!! git-lfs is pre-installed in Ubuntu 14.04 so users don’t have to install manually.

We don’t pre-install git-lfs but will do in the future container image release. In the meantime, you can install by your own.

dependencies:
  override:
    # Install git-lfs
    - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
    - sudo apt-get install git-lfs=1.1.0
    - ssh git@github.com git-lfs-authenticate <user>/<project>.git download

Please replace <user>/<project> with your own in order to authenticate git-lfs.

As of Dec 2015, git-lfs doesn’t support a deployment key, which CircleCI uses by default to checkout your repo, so you need to add a user key.

3 Likes

I tried it this way for a private repository, but git existed with code 1:

Deploy keys can not access Git LFS objects on private repositories Action failed: ssh git@github.com git-lfs-authenticate xxx/yyy.git download

Digging around it looks like it’s because Git LFS does not support deploy keys yet: https://github.com/github/git-lfs/issues/716#issuecomment-146251920

2 Likes

@moret

Git LFS does not support deploy keys yet

That’s correct. I’ll modify my original post to use a user key.

For iOS (OS X containers) usage of the above script results in the following error:

Unfortunately, your operating system distribution and version are not supported by this script.

You can override the OS detection by setting os= and dist= prior to running this script.
You can find a list of supported OSes and distributions on our website: packagecloud Documentation - Documentation for the Command-Line Interface (CLI) and automation tools

For example, to force Ubuntu Trusty: os=ubuntu dist=trusty ./script.sh

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash returned exit code 1

Instead you can use homebrew to install git-lfs like this:

dependencies:
  override:
    # Install git-lfs
    - brew install git-lfs
    - ssh git@github.com git-lfs-authenticate <user>/<project>.git download

I installed git-lfs with the above instrucitons. However, the large file in my repo is still not downloaded.
Tried with these commands:

dependencies:
    override:
      # Install git-lfs
      - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
      - sudo apt-get install git-lfs=1.1.0
      - ssh git@github.com git-lfs-authenticate <user>/<project>.git download
      - git lfs fetch
      - rm large_file
      - git checkout large_file

The large_file is still just a small text pointer file and the actual file is not downloaded.

fetch output:

git lfs fetch
Fetching dev

Git LFS: (0 of 1 files) 0 B / 294.43 MB

Git LFS: (0 of 1 files) 0 B / 294.43 MB

Any tips on how to trigger the download?

Solution was to use git lfs pull instead of git lfs fetch

I’m using trying to use git lfs pull with no result neither… :cry:

ubuntu@box84:~/vreasy$ git lfs pull Git LFS: (0 of 899 files) 0 B / 23.97 MB exit status 1 exit status 1 ubuntu@box84:~/vreasy$ git lfs fetch Fetching packaging-npm-deps Git LFS: (0 of 899 files) 0 B / 23.97 MB exit status 1 exit status 1

Ok, so this was an issue within github and in particular with the ssh git-lfs-authenticate command. I raised a support ticket to them and it is now fixed!

1 Like

Our iOS project fails because brew install git-lfs fails, complaining:

$ brew install git-lfs
Error: You must `brew unpin go` as installing git-lfs requires the latest version of pinned dependencies

brew install git-lfs returned exit code 1

Action failed: brew install git-lfs`

I am using the suggested solution, unpinning go, but it’d be nice if that wasn’t necessary.

my git lfs pull command always fails with the following message:

With git lfs v1.1.0 the process would fail silently, with v1.2.1 it quits circle ci

git lfs pull
Git LFS: (0 of 2 files, 2 skipped) 0 B / 723.49 KB, 723.49 KB skipped          
[404] Object does not exist on the server
[07fa5fc50d71851a2b1143d75c0e63106d34248bdab2fac57637b9d98ed5edb9] Object does not exist on the server

git lfs pull returned exit code 2

Action failed: git lfs pull

the circleci.yml file looks like :

dependencies:
  pre:
    - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
    - sudo apt-get install git-lfs=1.2.1
    - ssh git@github.com git-lfs-authenticate username/repo.git download
    - git lfs pull
    - git lfs pull

Is anyone able to point me in the right direction?

It seems like these instructions to install git-lfs in dependencies is out of date. It seems git-lfs is already installed now in CircleCI (Ubuntu 14.04 Build Image Update 201701-01). This page should probably be deleted or an update should be put at the top because it’s pretty confusing otherwise.