Synchronize brew packages across Eric's Macs
This repository houses the list of brew packages that Eric uses on his Mac computers. A script is provided that shouold be periodically run (weekly is suggested) to maintain the repository, install status, and update brew packages.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"cd ~
gh repo clone elsevers/brew-sync
cd brew-sync
brew bundle install
chmod +x sync-my-brew.sh
echo 'alias sync-my-brew="~/brew-sync/sync-my-brew.sh"' >> ~/.zshrc
source ~/.zshrcRun this script periodically (weekly is recommended):
sync-my-brewThis will:
- Update and upgrade all brew packages
- Pull in any new packages added ti git from another computer
- Commit to git and push up to GitHub any packages install on this computer
Removing a package from all Macs in the sync chain requires deliberate effort to prevent sync-my-brew.sh from reinstalling them. To remove packages, do the following:
First, make sure everything is sync'd:
brew-syncUninstall the package normally: brew uninstall <package-name>
Run the following commands:
cd ~/brew-sync
rm BrewFile
brew bundle dump -f
git add Brewfile
git commit -m "Remove package(s) from BrewFile"
git pushThis updates your Brewfile on GitHub so it no longer includes the package.
cd ~/dotfiles
git pull
brew bundle cleanup --force