LoginSignup
0
0

More than 3 years have passed since last update.

Error: unknown command "filter-proces" for "git-lfs"

Posted at

概要

作業内容としては、UnityのプロジェクトをAzurePipelinesでCI/CD対応をやってました。
Unityビルド対応は後でiOS/AndroidのProjectビルドをGitにPushして、AzurePipelines標準のiOS/Androidビルドを適応してアプリが正常にビルドと起動ができるのか確認、正常起動のみアプリをAppCenterに配布する想定で進めておりました。

Firebaseを使用しているので、./Assets/Firebase/Plugins/x86_64/FirebaseCppApp-6_8_0.so(約107M)がgit-lfsが必須となりすでに対応は済ませていました。
ですが、ブランチ切り替えての作業でgit lfs trackでtrackedされているファイルが消えたり作られたりすると次のエラーが起き始めていました。
また、まずはiOSビルドを先にAzurePipelines対応しようと作業していたため、Xcodeプロジェクトをgit pushする際に./xcode/libraries/libiphone-lib.a(約602M)もgit-lfs対応していたました。


$ git add .
Error: unknown command "filter-proces" for "git-lfs"

Did you mean this?
    filter-process

Run 'git-lfs --help' for usage.
fatal: The remote end hung up unexpectedly

このエラーについてググってみるものの参考になる記事が全く見当たらなかったので本記事にまとめたいと思います。

解決

結果的にGit LFSの使用方法 - Backlog ヘルプセンター記事の内容を参考になりました!

解決方法はいたってシンプルで、


# もしcommitなりしていたadd前に戻す
$ git reset --hard HEAD^

# `git-lfs`のtracked以外の編集内容を先にpushしておくと安全に作業できる
# ただしCI/CD対応がすでに完了している環境だったらこのpushはエラーになるかもなのでそのときの状況に応じてよしなに
$ git add . && git rm --cached -r ./xcode/libraries/libiphone-lib.a && git commit -m "Upload Xcode Project" && git push

# `git-lfs`の設定をリセットさせるとエラーが無くなった・・・
$ git lfs install
WARNING: The "filter.lfs.process" attribute should be "git-lfs filter-process" but is "git-lfs filter-proces"
Run `git lfs install --force` to reset git config.

$ git lfs install --force
Updated git hooks.
Git LFS initialized.

$ git add . && git commit -m "add git lfs file"
[develop xxxxxx] add git lfs file
 1 file changed, 3 insertions(+)
 create mode 100644 Xcode/Libraries/libiPhone-lib.a

$ git push

原因

今回のミスは2点でした。

  1. .gitattributesgit-lfsのtrackedファイルを一緒にPushしようとしていたこと
  2. Run 'git lfs install --force' to reset git config.を無視していたこと

1はそもそもgit-lfsの使用方法をちゃんと把握していなかったことでした汗
2はリセットする意味が分からず怖くてできなかったんですが、お手上げになったこともありやってみたところエラーは無くなりましたw

まとめ

ちゃんとツールの使用方法を把握しないとですねー

 

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