Last active
December 15, 2015 15:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
The ramdisk is populated with a temporary git repository during this process (so files are being written).
I guess I know what is going on ... the xargs
has a unnecessary -0
in my case.
updated the gist
Where is the file to keep specified?
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
The
git ls-files --full-name --cached | grep -F --invert-match --file=/tmp/list --color=never
part seems to work fine, it lists all files/dirs but not the formulae names listed in /tmp/list.The output is something like:
...and seems to succeed. I am not sure if the "Resource busy" is a problem or not.