# Installing git-lfs

**URL:** <https://discuss.circleci.com/t/installing-git-lfs/867>\
**Category:** Build Environment\
**Tags:** git-lfs\
**Created:** [December 2, 2015, 12:53am UTC](https://discuss.circleci.com/t/installing-git-lfs/867 "2015-12-02T00:53:32Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimh](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kimh/32/19_2.png) [@kimh](https://discuss.circleci.com/u/kimh)\
**Post date:** [December 2, 2015, 12:53am UTC](https://discuss.circleci.com/t/installing-git-lfs/867/1 "2015-12-02T00:53:32Z")

</div>

**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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![moret](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/moret/32/682_2.png) [@moret](https://discuss.circleci.com/u/moret)\
**Post date:** [December 10, 2015, 4:37pm UTC](https://discuss.circleci.com/t/installing-git-lfs/867/2 "2015-12-10T16:37:22Z")

</div>

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

```auto
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](https://github.com/github/git-lfs/issues/716#issuecomment-146251920)

---

<div class="post-metadata">

**Author:** ![kimh](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kimh/32/19_2.png) [@kimh](https://discuss.circleci.com/u/kimh)\
**Post date:** [December 11, 2015, 12:32am UTC](https://discuss.circleci.com/t/installing-git-lfs/867/3 "2015-12-11T00:32:51Z")

</div>

@moret

> Git LFS does not support deploy keys yet

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

---

<div class="post-metadata">

**Author:** ![ThuggishNuggets](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/thuggishnuggets/32/1522_2.png) [@ThuggishNuggets](https://discuss.circleci.com/u/ThuggishNuggets)\
**Post date:** [February 25, 2016, 10:56pm UTC](https://discuss.circleci.com/t/installing-git-lfs/867/4 "2016-02-25T22:56:23Z")

</div>

**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](https://packagecloud.io/docs#os_distro_version)
> 
> 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](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
> 
> ```

---

<div class="post-metadata">

**Author:** ![ttuulari](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@ttuulari](https://discuss.circleci.com/u/ttuulari)\
**Post date:** [March 15, 2016, 11:24am UTC](https://discuss.circleci.com/t/installing-git-lfs/867/5 "2016-03-15T11:24:02Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![ttuulari](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@ttuulari](https://discuss.circleci.com/u/ttuulari)\
**Post date:** [March 15, 2016, 12:04pm UTC](https://discuss.circleci.com/t/installing-git-lfs/867/6 "2016-03-15T12:04:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brutuscat](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/brutuscat/32/2704_2.png) [@brutuscat](https://discuss.circleci.com/u/brutuscat)\
**Post date:** [July 20, 2016, 3:58pm UTC](https://discuss.circleci.com/t/installing-git-lfs/867/7 "2016-07-20T15:58:32Z")

</div>

> [@ttuulari](#):
>
> git lfs fetch

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

`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 `

---

<div class="post-metadata">

**Author:** ![brutuscat](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/brutuscat/32/2704_2.png) [@brutuscat](https://discuss.circleci.com/u/brutuscat)\
**Post date:** [July 26, 2016, 11:14pm UTC](https://discuss.circleci.com/t/installing-git-lfs/867/8 "2016-07-26T23:14:53Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![brendonjustin](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/brendonjustin/32/2981_2.png) [@brendonjustin](https://discuss.circleci.com/u/brendonjustin)\
**Post date:** [September 9, 2016, 3:48pm UTC](https://discuss.circleci.com/t/installing-git-lfs/867/9 "2016-09-09T15:48:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![peter-mouland](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/peter-mouland/32/14230_2.png) [@peter-mouland](https://discuss.circleci.com/u/peter-mouland)\
**Post date:** [September 23, 2016, 2:55pm UTC](https://discuss.circleci.com/t/installing-git-lfs/867/11 "2016-09-23T14:55:33Z")

</div>

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

```auto
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 :

```auto
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?

---

<div class="post-metadata">

**Author:** ![matthayes](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/matthayes/32/15452_2.png) [@matthayes](https://discuss.circleci.com/u/matthayes)\
**Post date:** [February 14, 2017, 11:37pm UTC](https://discuss.circleci.com/t/installing-git-lfs/867/12 "2017-02-14T23:37:33Z")

</div>

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](https://discuss.circleci.com/t/ubuntu-14-04-build-image-update-201701-01/9245/8)). This page should probably be deleted or an update should be put at the top because it’s pretty confusing otherwise.

---

<div class="post-metadata">

**Author:** ![kimh](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kimh/32/19_2.png) [@kimh](https://discuss.circleci.com/u/kimh)\
**Post date:** [February 15, 2017, 8:13am UTC](https://discuss.circleci.com/t/installing-git-lfs/867/13 "2017-02-15T08:13:01Z")

</div>

Archived on February 15, 2017, 8:13am UTC



---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:37am UTC](https://discuss.circleci.com/t/installing-git-lfs/867/14 "2018-06-18T11:37:42Z")

</div>

Closed on June 18, 2018, 11:37am UTC


