I am working to move a git repo from one provider to another. As part of that process the new repo is being rejected on push due to the size of a file in the history (file was removed months ago but still exists in history).
I found both git filter-branch
and BFG repo-cleaner
as options to correct this. They work as expected and allow me to push to the new repo but I am finding any ref with the signature task/my-branch
get duplicated to Task/my-branch
and I cannot find any reference that would explain why or how to avoid this. Worst case scenario I can clean these manually after the move but would like to understand better why its happening and if there is a way to prevent it.
steps taken with BFG cleaner
1) git clone --bare ssh://path/to/repo.git
2) cd repo.git
3) git branch -a
observe branches such as task/my-branch
4) cd ..
5) java -jar bfg.jar --delete-files repo.git
6) git reflog expire --expire=now --all && git gc --prune=now --aggressive
7) git branch -a
observe branches such as task/my-branch
AND Task/my-branch
similar process with git filter-branch
1) git clone --bare ssh://path/to/repo.git
2) cd repo.git
3) git branch -a
observe branches such as task/my-branch
4) git filter-branch -f --prune-empty --tag-name-filter cat --tree-filter 'rm -f -- --all
5) git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
6) git reflog expire --expire=now --all && git gc --prune=now --aggressive
7) git branch -a
observe branches such as task/my-branch
AND Task/my-branch