Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Housekeeping is here for .git #128

Closed
vipulgupta2048 opened this issue Oct 20, 2018 · 3 comments
Closed

Housekeeping is here for .git #128

vipulgupta2048 opened this issue Oct 20, 2018 · 3 comments

Comments

@vipulgupta2048
Copy link
Member

As a repository becomes older and older. The number of commits, branches, assets stored takes a toll on git. The biggest strength of git is also its biggest flaw. It remembers everything.

Well, only until one authorizes it to forget.

Task
Follow the guide to reduce the size of .git folder in the repository (Which is now 22.7 mb) to somewhat lesser than that.

To help here are some great guides 1, 2,

@Sc0rpi0n101
Copy link
Member

Wait, how is this a good first issue?
For people who don't have much experience with Open-source & prob git and are looking for thier first issue, housekeeping git might not be the right thing to start on xD.

@vipulgupta2048
Copy link
Member Author

I agree, I had a perspective of someone be able to learn more about git, amd how it works internally by doing this task. Reassessing, yes definitely not a good first issue

@nmay231
Copy link

nmay231 commented Jan 20, 2020

Well, I was just taking a look to see how reasonable it would be to work on this and I don't know if it is honestly. It looks like most of the large size is due to existing/previous versions of existing images.

I just made a fresh clone, then ran

git verify-pack -v .git/objects/pack/pack-a0a3d6c2cbc90fce318270c3aaad78c9af0c293e.idx | sort -k 3 -n | cut -c-41 | tail -150 >> tmp.txt

to get the shas of the largest 150 commits. Then to get the file names,

git rev-list --objects --all | grep -f tmp.txt

It looks like most of them are presently existing files in images/ and fonts/. And while I wish I could run a command to find the exact files that could safely be removed from history, I'm not that skilled with git.

My suggestion, if low first-clone-size is at all a priority, you should gitignore all images and from previous commits, and then just store your images somewhere else other than github. Though, it seems like that's more work than it's worth. It is only the first clone after all.

Just FYI 👍

@Sc0rpi0n101 Sc0rpi0n101 added this to Ideas in Website Redesign Aug 20, 2020
@ashwinky ashwinky closed this as completed Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants