Automatically configures Git LFS for all repositories in your GitHub account.
-
Generate GitHub Token
- Go to github.com/settings/tokens
- Click "Generate new token (classic)"
- Select scopes:
- repo (Full control)
- workflow
- admin:org
- delete_repo
- Copy the generated token
-
Server Setup
cd /root
git clone https://github.com/aclrys/github-lfs.git
cd github-lfs
- Configure Settings
cp config.env.template config.env
nano config.env # Add your details:
Required config.env values:
GITHUB_TOKEN="your_token"
GITHUB_USERNAME="your_username"
GITHUB_EMAIL="your@email.com"
LFS_BASE_DIR="/root/github-lfs"
ALERT_EMAIL="your@email.com"
- Deploy
chmod +x deploy-lfs.sh
./deploy-lfs.sh
- Auto-configures LFS for new repositories
- Moves files >5MB to LFS storage
- Monitors storage usage
- Email alerts for storage threshold
- Logs: /root/github-lfs/logs/
- Monitor script: /root/github-lfs/scripts/monitor.sh
- Storage alerts: Configured email