Skip to content

Instantly share code, notes, and snippets.

@dangra
Last active December 12, 2015 01:48
Show Gist options
  • Save dangra/4693361 to your computer and use it in GitHub Desktop.
Save dangra/4693361 to your computer and use it in GitHub Desktop.
#!/bin/bash
# GistID: 4693361
rm -rf scrapyd
git clone scrapy scrapyd
(
cd scrapyd
git remote rm origin
echo 0.7 0.7-rc1 0.8 0.9 0.9-rc1 0.10-rc1 |xargs git tag -d
git filter-branch \
--prune-empty \
--tag-name-filter cat \
--index-filter '
git ls-files -s \
| sed "s-\t-&scrapyd/-" \
| GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info \
&& mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' \
--subdirectory-filter scrapyd \
-- --all
du -sh .
git reset --hard
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git reflog expire --expire=now --all
git gc --aggressive --prune=now
du -sh .
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment