github - Removing all deleted files from git repo history w search command -
had start version controlling project not in version control. result repo 17gb , needs paired down if going repo github (the site paired down 600mb).
basically want remove have deleted in process of pairing down repo completely. i've found great command find every deleted file.
git log --all --pretty=format: --name-only --diff-filter=d | sort -u
which lists files beautifully.
now how pipe in command necessary clear history. along these lines.
git filter-branch --tree-filter 'rm -rf { file }' head
i've made backup copy of repo if totally screw things okay.
is right command loop files into? , if how do this?
ok, xargs needs little help. need use 1 per line, substituted filter-branch command:
git log --all --pretty=format: --name-only --diff-filter=d | sort -u | while read -r line; git filter-branch -f --tree-filter "rm -rf { $line }" head; done
we must specify -f flag filter-branch remove old refs, per purging file git repo failed, unable create new backup
Comments
Post a Comment