Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Is deleting/recreating a branch easiest way to remove large files in history?

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?

1 answer

1 accepted

1 vote
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 01, 2023

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>

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 02, 2023

Yes, that is correct.

Thanks.  Just to verify: this will only affect the branch I am working on; it won't affect the main branch.  Is that correct?  

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 27, 2023

As long as you have not merged the push to the main branch then you will be good.

Like Steve Novotny likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events