Skip to content

Instantly share code, notes, and snippets.

@seaders
Created October 10, 2016 14:13
Show Gist options
  • Save seaders/ee2e69ab17191a8420995115bc5dade1 to your computer and use it in GitHub Desktop.
Save seaders/ee2e69ab17191a8420995115bc5dade1 to your computer and use it in GitHub Desktop.
git clone <PRIVATE REPO>
cd sdk
git fetch --all
git pull --all
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
git branch --track "${branch##*/}" "$branch"
done
git fetch --all
git pull --all
cd ..
cp -r sdk private-android
cd private-android
git remote rm origin
git clean -dfx
git reset --hard HEAD
git filter-branch -f --prune-empty --subdirectory-filter android -- --all
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git reflog expire --expire=now --all
git gc --prune=now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment