casperdcl / cli

GitHub’s official command line tool

Home Page:https://cli.github.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GH snap does not include git-lfs and fails on repos with LFS content

RobertCoop opened this issue · comments

Describe the feature or problem you’d like to solve

I attempted to review a PR on a git-lfs-enabled repo. Error occurred:

gh pr checkout 89
Branch 'xxx' set up to track remote branch 'xxx' from 'origin'.
Switched to a new branch 'xxx'

This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.

exit status 1

Proposed solution

Problem was solved by putting git-lfs binary into the snap filesystem:

sudo unsquashfs -d /tmp/ghsnap /var/lib/snapd/snaps/gh_502.snap
cd /tmp/ghsnap/usr/bin
sudo cp /usr/bin/git-lfs .
sudo snap try /tmp/ghsnap/