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
  • Issues
  • #1930

Closed
Open
Created Nov 06, 2012 by Administrator@rootOwner

Wrong file owners when pushing over HTTP

Created by: dfyx

Whenever someone pushes over HTTP, all new and changed files are assigned to the user gitlab instead of git. As a result of this the whole branch disappears for everybody who tries to pull/push over SSH.

Here's an example of which files were affected after I pushed a single commit.

$ sudo ls -lR /home/git/repositories/foo_bar.git/ | grep gitlab
drwxrws--- 2 gitlab gitlab 4096 Nov  6 11:44 1f
drwxrws--- 2 gitlab gitlab 4096 Nov  6 11:44 5d
drwxrws--- 2 gitlab gitlab 4096 Nov  6 11:44 a3
-r--r----- 1 gitlab gitlab 18 Nov  6 11:44 630bb0d3886c53b7535b4736d9ba2e35c090f8
-r--r----- 1 gitlab gitlab 176 Nov  6 11:44 47b655488b6562404d98fea656d41e8a1e2fb5
-r--r----- 1 gitlab gitlab 51 Nov  6 11:44 10adfebb3dfc43c9fdd056e7d0244a82eca858
-rw-rw---- 1 gitlab gitlab 41 Nov  6 11:44 master

When I clone over SSH afterwards

$ git clone [email protected]:foo_bar.git
Cloning into 'foo_bar'...
warning: You appear to have cloned an empty repository.

While over HTTP everything still works

$ git clone http://mydomain.com/foo_bar.git
Cloning into 'foo_bar'...
Username for 'http://mydomain.com':
Password for 'http://mydomain.com':
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 12 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (12/12), done.

To confirm that there isn't another problem I ran sudo chown -R git:git /home/git/repositories/ and everything worked fine again but of course this isn't a permanent solution.

Assignee
Assign to
Time tracking