Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !1719

Merged
Created Oct 17, 2012 by Administrator@rootOwner

add shared repository support

  • Overview 38
  • Commits 1
  • Changes 1

Created by: SaitoWu

Problem

The original bug report comes from here: https://groups.google.com/forum/?fromgroups=#!topic/gitlabhq/l1wSZmULJSo

Cause

This is a grack and gitolite cowork problem.

If u push over SSH, ur .git/objects 's permission look like this:

drwxrwx---  git:git

when u push over HTTP, ur .git/objects 's permission looks like this:

drwxr-xr-x gitlab:gitlab

so, git user didn't have group write permission on that object, and gitlab user will always have push permission.

Fix

To fix this problem, we need add a git config to each repo.

[core]
    sharedRepository = 0660

this will always give objects folder a drwxrws--- permission. like gitolites umask variable.

Gitolite support git config varible.

Our gitolite-client also support config variable, its easy to use:

repo.set_git_config("core.sharedRepository", "0660")

also we need edit .gitolite.rc file

GIT_CONFIG_KEYS             =>  '.*'

when we done what we do.

our new repo will have this in the config:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = true
    sharedRepository = 0660 

And all things will work again.

TL;DR

merge this patch

edit .gitolite.rc file, GIT_CONFIG_KEYS => '.*'

will fix this problem.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/SaitoWu/features/sharedRepository