Multiple users for single git repository
Asked Answered
L

3

6

We have a single server which is being used by multiple users. Disk space is quite the limitation as our git repo is quite huge and every time someone clones it, it consumes 130G of space.

I understand that git is not designed to be centralised workflow but this is a very peculiar situation. We thought about upgrading the hardware but that's quite a long path as it's not a cloud instance.

I tried fiddling with git worktree but I soon ran into permission issues. My Ideal setup would be a single repo and multiple users can push and pull via through this.

I looked into the previous threads on this but unfortunately nothing solid advice over there and they are quite old threads. So, any new advice would be highly appreciated.

Lietuva answered 22/11, 2020 at 11:13 Comment(3)
How are you serving this git repo? Are you just sharing it over SMB or using something like GitHub Enterprise or TFS?Poulenc
Also, why would a repo be 130GB? You should not be storing binaries in a git repo... that's what LFS is for.Poulenc
We have our in house git server and we use gerrit on top of it. And regarding 130 GB, yeah, we have huge amount of config files and fit files ( we could have used DB but it's the historical business decision to keep everything in the git repo )Lietuva
L
3

Another approach is to use git worktree, in order to checkout multiple branches in multiple different path, while keeping only one cloned repository.

Combine that with some partial clone with filter and sparse cone and:

  • your main repository can be smaller than it is today (because some files not needed for your collective work are filtered, and because not the full history is fetched)
  • your different branches are checked out without having to clone again the repository.
Longlegged answered 26/11, 2020 at 20:59 Comment(0)
N
1

Perhaps look into git subtree or git submodule to divide your big git repo into several smaller ones. It still stays the same big repo, but can be more manageable.

Notice for submodules:

When you clone such a project, by default you get the directories that contain submodules, but none of the files within them yet

So when you say

$ git clone https://github.com/myco/MainProject

it only downloads the main repo and the folders of the sub modules. You can then specify which submodule files you want to download with.

$ cd subModuleDir
$ git submodule init
$ git submodule update

Thus, it only clones the files for the submodule and not all the files.

Nichellenichol answered 26/11, 2020 at 14:47 Comment(0)
C
1

I'm not sure about what you are asking here: you have a single machine being used by multiple users, and each clone is destroying the available space.

Then, just have a single copy, in a folder accessible to all windows users, and have each person work on a separate branch there.

Appoint someone as "manager" to manage merge on master and curation of the "blessed" information.

Codon answered 26/11, 2020 at 14:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.