Avoid deduplication of objects when forking #10851

Open
opened 2025-11-02 09:20:01 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @sad75 on GitHub (May 15, 2023).

Feature Description

At fork time, Gitea creates a Git repository for the new project. This repository is a copy of the original project. When forking large projects, it consumes a lot of disk space.

Other git servers make use of the Git alternates feature :

It would be nice to have such an optimization in Gitea.

Screenshots

No response

Originally created by @sad75 on GitHub (May 15, 2023). ### Feature Description At fork time, Gitea creates a Git repository for the new project. This repository is a copy of the original project. When forking large projects, it consumes a lot of disk space. Other git servers make use of the [Git alternates feature](https://git-scm.com/docs/gitrepository-layout#Documentation/gitrepository-layout.txt-objectsinfoalternates) : - Github: Fork would not duplicate (on the server side) the full repository, as explained in [Counting Objects](https://github.blog/2015-09-22-counting-objects/#your-very-own-fork-of-rails) - GitLab: [How Git object deduplication works in GitLab](https://docs.gitlab.com/ee/development/git_object_deduplication.html) It would be nice to have such an optimization in Gitea. ### Screenshots _No response_
GiteaMirror added the type/proposalproposal/acceptedtype/feature labels 2025-11-02 09:20:01 -06:00
Author
Owner

@silverwind commented on GitHub (May 15, 2023):

GitHub's deduplication method also has the downside that a fork's branches are actually part of the main git repo on the server, so content in them can be made to appear as part of the original repo on the UI as has happend in the past on GitHub's DMCA repo.

@silverwind commented on GitHub (May 15, 2023): GitHub's deduplication method also has the downside that a fork's branches are actually part of the main git repo on the server, so content in them can be made to appear as part of the original repo on the UI as has [happend in the past](https://news.ycombinator.com/item?id=24882921) on GitHub's DMCA repo.
Author
Owner

@lunny commented on GitHub (May 16, 2023):

Yes, so we need to find object's origin repository if we use this method. I have sent #18459 to try to have a warning once view a commit which actually don't belongs to the main repository.

@lunny commented on GitHub (May 16, 2023): Yes, so we need to find object's origin repository if we use this method. I have sent #18459 to try to have a warning once view a commit which actually don't belongs to the main repository.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10851