I tried this tutorial to delete some sensitive files and directories from my Git history. However, at the end, my new repository only had 1 branch: the master branch.
How is possible to delete files and directories from Git history while keeping all branches?
Thank you!
commands I used (from the tutorial):
cd /tmp
git clone https://MY_GIT_REPOSITORY.git workingrepo
cd workingrepo
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
git filter-branch --tag-name-filter cat --index-filter 'git rm -r --cached --ignore-unmatch FILE_LIST' --prune-empty -f -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --aggressive --prune=now