How to reduce github repo size in remote? #139506
Replies: 4 comments 3 replies
-
Yes, you can run garbage collection on the remote repository, but it's important to note that Git services like GitHub typically don't allow users to directly run Git's garbage collection (git gc) on the remote server for security and stability reasons. |
Beta Was this translation helpful? Give feedback.
-
Thanks for posting in the GitHub Community, @Saranpjs727 ! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Discussions category is solely related to conversations around the GitHub product Discussions. This question should be in the Repositories category. I've gone ahead and moved it for you. Good luck! |
Beta Was this translation helpful? Give feedback.
-
Running git gc on a remote repository directly (e.g., on GitHub or other Git hosting services) is not possible. The garbage collection process is generally a local operation, and remote Git hosting services like GitHub automatically perform it periodically to clean up orphaned or unreachable objects. However, you can try a few alternatives to help reduce the size of your remote repository: Clean up your repository locally using git filter-repo or git filter-branch. Let me know if this helped |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I have a GitHub repository that contains nearly 21GB of data.
When I try to retrieve unreachable objects using git fsck --full --unreachable, I see many entries.
I removed all unreachable objects using git gc --prune=now.
I performed all these steps locally, and the size of the repository was reduced to 11GB.
Is there any way to run the garbage collector manually or via a script in remote?
Beta Was this translation helpful? Give feedback.
All reactions