Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #40765
Closed
Open
Created Dec 02, 2017 by Roman Semenov@poma1

gitlab-rake gitlab:import:repos creates empty repositories

Summary

gitlab-rake gitlab:import:repos doesn't work at all in the official docker container gitlab/gitlab-ce

Steps to reproduce

# create a test repo with 1 commit
mkdir test && cd test && git init && echo test > test.txt && git add . && git commit -m "test" && cd ..
# make it bare
git clone --bare test

# launch the latest 10.2.2-ce gitlab container
docker run -Pd -v "$(pwd)":/data --name gitlab gitlab/gitlab-ce:10.2.2-ce.0

# wait for it to start, open it in browser and set password for root user, log in

# ssh in and follow instructions from https://docs.gitlab.com/ce/raketasks/import.html
docker exec -ti gitlab bash
mkdir /var/opt/gitlab/git-data/repository-import-2017-12-01
mkdir /var/opt/gitlab/git-data/repository-import-2017-12-01/new_group
cp -R /data/test.git /var/opt/gitlab/git-data/repository-import-2017-12-01/new_group
chown -R git:git /var/opt/gitlab/git-data/repository-import-2017-12-01
gitlab-rake gitlab:import:repos['/var/opt/gitlab/git-data/repository-import-2017-12-01']

# output:
# Processing /var/opt/gitlab/git-data/repository-import-2017-12-01/new_group/test.git
# * Using namespace: new_group
# * Created test (new_group/test)

Checks

  1. go to /new_group/test in browser and observe repo
  2. run cd /var/opt/gitlab/git-data/repositories/new_group/test.git && git log to see repo commits

Expected result:

  1. See test repo with test.txt and 1 commit
  2. git log shows 1 commit

Actual result:

  1. See empty repo
  2. git log shows fatal: your current branch 'master' does not have any commits yet

Additional notes

With larger repos it looks like GitLab copies actual data but deletes all references, because repo size after import is the same as before

Edited Dec 02, 2017 by Roman Semenov
Assignee
Assign to
Time tracking