epcim
2/1/2017 - 7:16 AM

git-annex shrink size of repository. From http://git-annex.branchable.com/forum/safely_dropping_git-annex_history/


# check
git status 

# verify there are no uncommitted or untracked files

# master branch
git branch -m old-master
git checkout --orphan master
git add .
git commit -m 'first commit'

# git annex branch
git branch -m git-annex old-git-annex
git checkout git-annex
git checkout --orphan git-annex
git add .
git commit -m 'first commit'
git checkout master

# at this point, you may want to double-check that everything is still OK

# finally, remove branches and clean up the objects:
git branch -D old-master old-git-annex
git reflog expire --expire=now --all
git prune
git gc