Skip to content

Instantly share code, notes, and snippets.

@samueljohn
Last active December 15, 2015 15:19
Show Gist options
  • Save samueljohn/5280700 to your computer and use it in GitHub Desktop.
Save samueljohn/5280700 to your computer and use it in GitHub Desktop.
Moving homebrew formulae from one repo (mxcl/master) into another one... Based on @jacknagel's instructions.
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1048576`
cd $(brew --repository)
git checkout -b moveit
git filter-branch --prune-empty --index-filter 'git ls-files --full-name --cached | grep -F --invert-match --file=/tmp/list --color=never | xargs git rm --quiet --cached --ignore−unmatch' --subdirectory-filter 'Library/Formula' -d /Volumes/ramdisk -f moveit
cd the-target-repro
git fetch $(brew --repository)
git merge moveit
@adamv
Copy link

adamv commented Aug 31, 2013

Where is the file to keep specified?

@samueljohn
Copy link
Author

The files to move are in /tmp/files in this example. I should update the gist with a line to populate that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment