Created
November 20, 2018 06:19
-
-
Save zilongshanren/496727a403c954e0bc40d09491d075cb to your computer and use it in GitHub Desktop.
SVN迁移Git
This file contains hidden or 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
使用 git svn clone 更新仓库,然后使用下面的命令重写commit历史去除大文件。 | |
然后再push到远程仓库。 | |
1. git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | awk '{if($3>524288000) print$1}')" > large-files.txt,将所有大于500M的提交文件列出来 | |
2. cat large-files.txt| awk '{print $2}' | tr '\n' ' ' > large-files-inline.txt | |
3. git filter-branch -f --prune-empty --index-filter "git rm -rf --cached --ignore-unmatch `cat large-files-inline.txt`" --tag-name-filter cat -- --all | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment