I know that reset can be used to backup to previous commits, but is deleting and recreating the branch a quicker and easier way to reduce the size of a branch with large files scattered throughout the commit history?
Hi @Steve Novotny,
Welcome to Atlassian Community!
Branches are just pointers to different parts of the history and removing a branch will have no effect on the size of the repository, since the history of the large files is still in it. The only way to remove large files from the history is to clear the history out. You can read more about in this KB.
Thank you. That's what I feared.
I'm assuming if I want to back up to before the big files were pushed, I do the following:
git branch <keeper>
git reset --soft <commit id before big push>
git push --force
git merge --ff-only <keeper>
git branch -d <keeper>
Yes, that is correct.
It looks like you're new here. Sign in or register to get started.