This GitHub CLI extension will migrate a repo to LFS. WARNING: This is destructive!! I recommend you test this operation on a fork first! The repo pull requests will be outdated after this operation because the commit shas will change as a result of the history being rewritten.
This will:
- Clone the repo
- Migrate files with the provided extension to LFS
- Commit lfs-mapping.csv file on default branch showing old sha to new sha mapping
- Force push all repo branches back to the origin
- Forge push all tags
You need write access to the repo. The repo needs to allow force pushes to all branches. It's probably best to disable any branch protection rules that may be in place before running this.
gh extension install robandpdx/gh-lfser
gh extension upgrade robandpdx/gh-lfser
gh lfser --extensions <extensions> --repo <repo>
gh lfser --help
gh lfser --extensions "*.dmg,*.png,*.jpg" --repo robandpdx/el-repo-mas-grande