-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Large files in git #681
Comments
Yes that sounds good. Let’s re write history and prevent files larger than
1mb.
…On Fri, Mar 25, 2022 at 3:03 AM Martin Thoma ***@***.***> wrote:
I've noticed some astonishingly large files in this repository (in the git
history):
81ebba90f411 1,4MiB buildJvm/build_53_King_kotlin/build/install/build_53_King_kotlin/lib/kotlin-stdlib-1.6.0.jar -- added via fe4219d
eeb85bc8ea11 4,4MiB 53_King/kotlin/king.jar -- added via fe4219d
7c624e47ff0f 25MiB 89_Tic-Tac-Toe/python/TicTacToe_exe/TicTacToe.exe -- added via 3efe6e3
65c61eb509d6 34MiB 39 Golf/csharp/compiled/linux_x86/golf -- added via 0dbb491
5222483d2f8c 66MiB 39 Golf/csharp/compiled/windows_x86/golf.exe -- added via 0dbb491
They are all already deleted, but still in the git history. This makes
this repository way bigger than necessary. I've just seen a warning by
Github about which I was confused ... and especially about the executable
in 89_Tic-Tac-Toe/python. I initially thought I had done something wrong.
Re-write history
We could remove those from the git history:
https://stackoverflow.com/a/2158271/562769
However, I have to admit that re-writing git history always feels scary to
me
Prevent it in future
I would like to do two things:
1. Add the pre-commit hook check-added-large-files
<https://github.com/pre-commit/pre-commit-hooks#check-added-large-files>
2. Check in the CI if a large file was added (the simplest way to do
it would be to run pre-commit in CI, but I would like to avoid that ... I
need to check how to do this)
Does this sound like a good idea to you?
What would be a good maximum file size?
—
Reply to this email directly, view it on GitHub
<#681>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALTWVP5KOVCOAXXOYKJZRLVBWFNLANCNFSM5RTWEPNQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Git History RewriteI propose to do the following:
Maybe we should also disable force-pushes on History Rewrite Option 1: Manual
History Rewrite Option 2: AutomaticDelete all files from the history that are no longer there. I'm uncertain what happens with files that were moved!
Alternatively, you could use this
|
The effect of this:
When you now execute this snippet you can see:
In case we don't need the buildJvm folder, we could reduce the allowed file size from 1MB to 200 KB. |
I think we have definitely decided we don't want any build or IDE specific files in the repo, so proceed accordingly there... |
If I should do it, I would give @AlaaSarhan time until Monday to finish #404 . If possible, I would like to prevent open PRs. Should I do it? Does it sound good to wait until #404 is merged / Monday (whatever is earlier)? |
Sure! Sounds good to me. |
As discussed here: #681 (comment)
The history re-write is done. Please clone from the current repository |
OK! I cloned the repo from scratch and it looks good to me! Thank you! |
I've noticed some astonishingly large files in this repository (in the git history):
They are all already deleted, but still in the git history. This makes this repository way bigger than necessary. I've just seen a warning by Github about which I was confused ... and especially about the executable in
89_Tic-Tac-Toe/python
. I initially thought I had done something wrong.Re-write history
We could remove those from the git history: https://stackoverflow.com/a/2158271/562769
However, I have to admit that re-writing git history always feels scary to me
Prevent it in future
I would like to do two things:
check-added-large-files
Does this sound like a good idea to you?
What would be a good maximum file size?
The text was updated successfully, but these errors were encountered: