LoginSignup
5
6

More than 5 years have passed since last update.

git lfs pull を毎回しなきゃいけなくなった時にやったこと

Posted at

はじめに

Github で Git LFS が使えるようになったので、iOS で使ってる SDK を、LFS で管理してたら、
git reset した後とかに、 git lfs pull しないと build が失敗が失敗する問題が発生。

更に、git lfs pull すると必ず index に入っちゃうので、セットで git reset までしなきゃいけない状態で、
かなりめんどくさくて調べて解決した時のメモ。

ちなみに、ローカルのリポジトリを削除して、再度 clone だと解決できなかった。

解決方法

git lfs install を実行して、git reset する

$ git lfs install
Updated pre-push hook.
Git LFS initialized.
$ git reset
$ git lfs pull
Git LFS: (0 of 7 files) 0 B / 124.40 MB
Git LFS: (0 of 7 files) 0 B / 124.40 MB
$ git status
On branch develop
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

ただ、git-lfs のバージョンが古いと、unknown command になるので、バージョンアップが必要

brew でのアップデート

$ git lfs install
Error: unknown command "install" for "git-lfs"
Run 'git-lfs --help' for usage.
$ git lfs version
git-lfs/1.0.2 (GitHub; darwin amd64; go 1.5.1)
$ brew update git-lfs
Error: This command updates brew itself, and does not take formula names.
Use 'brew upgrade <formula>'.
$ brew upgrade git-lfs
==> Upgrading 1 outdated package, with result:
git-lfs 1.1.2
==> Upgrading git-lfs
==> Downloading https://homebrew.bintray.com/bottles/git-lfs-1.1.2.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-lfs-1.1.2.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/git-lfs/1.1.2: 5 files, 11.6M
$ git lfs version
git-lfs/1.1.2 (GitHub; darwin amd64; go 1.6)

参考URL: stackoverflow

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6