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

Removing items from git history and repo

rctneil July 8, 2017

Hey, I committed over 600 large(ish) jpgs to my git repo and can now see the error of my way. I have used the BFG to remove them and my local repository no longer shows them. My local git GUI doesn;t show them. If I check the size of the repo in Finder then it shows 119Mb.

 

But...

The repo size on BitBucket still shows 1.6Gb. If I choose to download the repo from BB then I get a 119Mb file downloaded.

I also ran the following command:

 

while read -r largefile; do     echo $largefile | awk '{printf "%s %s ", $1, $3 ; system("git rev-list --all --objects | grep " $1 " | cut -d \" \" -f 2-")}'; done <<< "$(git rev-list --all --objects | awk '{print $1}' | git cat-file --batch-check | sort -k3nr | head -n 20)"

 

and that shows a whole load of large files that I thought had been cleared out by BFG.

 

Any ideas how I can resolve it.  I'm not fully versed with Git so please go easy on me! :-)

2 answers

2 accepted

0 votes
Answer accepted
Vipul Shivnani October 5, 2017

@Ana RetamalHi Ana , I am having similar issues with BFG. After I ran it doubles (approximately) the size of my repo. on local it shows half when i run the git count-objects . Can you please help??

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2017

Hi @Vipul Shivnani! I've run a garbage collection on your remote repository and the size decreased to 1.5 GB. Is there anything else I can help you with?

Cheers :)

Ana 

Vipul Shivnani October 6, 2017

@Ana Retamal Ortiz you are awesome Thanks.

I was actually doing this on a test repo. I will do this now on my prod repo. Will you be able run it again after I do so ?

Once again appreciate your help. Thanks.

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2017

Sure @Vipul Shivnani. Drop me a line here and I'll try to run it as soon as I see your message :)

Have a nice day!

Ana

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2017

Sure @Vipul Shivnani. Drop me a line here and I'll try to run it as soon as I see your message :)

Have a nice day!

Ana

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2017

.

0 votes
Answer accepted
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 10, 2017

Hi Neil! Git doesn't handle binary files very well, so sometimes it needs some help. I've run an aggressive gc on your repo and the size of the remote has now decreased to 93 MB.

Is there anything else I can help you with? :)

Cheers,

Ana

rctneil July 10, 2017

Awesome!  Thankyou so much. Much better and I promise to learn my lesson from this. :-)

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 17, 2017

No problem, Neil :) Glad I could help you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events