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

Git GC Remote

Gabriel Hillesheim da Silva August 25, 2021

Hy, I ran BFG over my repo, push all the files I've cloned with '--mirror', when I type 

"git count-objects -v"  I get this 

count: 3
size: 3
in-pack: 1607
packs: 1
size-pack: 68472
prune-packable: 0
garbage: 0
size-garbage: 0

But in BitBucket size information still warning me about the size.

'<repo_name_removed>' is the repo name.

How can this be solved?

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2021

Hi @Gabriel Hillesheim da Silva and welcome to the community.

I ran a git gc for this remote repository and its size is now 66.5 MB.

Is the warning gone now and is the size updated in the repository settings?

Just a heads up, I removed the repo name from your post for privacy reasons.

Kind regards,
Theodora

Gabriel Hillesheim da Silva August 25, 2021

Hello, 

Yes, the repo size is now updated, thank you !! 

When necessary, is it always required to ask to run the git gc? Is there any configuration I can do to run automatically ?

 

Thank you! 

Have nice day!

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 27, 2021

Hi Gabriel,

Thank you for the update and you are very welcome, I'm glad to have helped!

There is an automated git gc that runs on every push, however, it runs with different options than the ones used when I manually ran it.

We have a Labs feature "Delete dangling commits when over size limit" that can be found here:

This is useful when the repo goes over the size limit as a result of a large commit that you want to undo. In this case, if the Labs feature is enabled, you can reset to the commit prior to the large one, push to Bitbucket, and a git gc will run which will delete the large files you remove from history when you rewind your branch head. You can read more about this here.

If you rewrite a repo's history with BFG or git filter-branch, you'll need to post a question here and ask that we run a git gc, as the automated one doesn't remove the old references from the repo.

Please feel free to let me know if you have any other questions!

Kind regards,
Theodora

Swati Singh September 9, 2021

Hi @Theodora Boudale ,

I want to delete some large files from git history. 
The scenario is, those files were added accidentally in a feature branch and later I deleted them and commit again in the same branch. Now that branch has been merged to master and got deleted. We have multiple commits and PRs merged to master after that bad commit.

As those files are still there in git history, they are consuming space in bitbucket and I am getting warning for that. 

I was trying to find out a mechanism to delete those files from that commit#.

BFG tool is doing the needful but there are few concerns:

1. approx 50 folks are working on this repo
2. there are Jira tickets having commit# and PRs, and if we use BFG, that will rewrite history and create new commit #. In that case, we need to update those Jira tickets with correct commit# (Jira tickets count is unknown)
3. bad commit was done on 19th August 2021 and we have multiple PRs merged and branches created after that

Please suggest if there is a better way to do, addressing above points.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 13, 2021

Hi @Swati Singh,

A new question was posted with similar concerns here:

I'm not sure if the question was created by one of your team members or not? You can check what I have responded there and let me know if you have any questions.

Kind regards,
Theodora

Swati Singh September 13, 2021

Hi @Theodora Boudale

Yes that ticket was raised by my team member. Thanks for your response.

Regards,
Swati

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events