- We clone a big repository from gitolite as bare repository
- We migrate it with git lfs migrate import --everything --include=" .png, .zip"
- We clean the repository git reflog expire --expire=now --all && git reflog expire --expire-unreachable=now --all && git gc --prune=now --aggressive
- We do a git lfs install
- We prepare the repo for push to our test gitlab.example git remote rename origin old-origin git remote add origin “git@gitlab.example:namespace/repo.git”
- We push the repo git push -u origin --all git push -u origin --tags
- We delete the gitlab repo.git from our gitlab.example
- We make sure all background project destroy jobs and lfs delete jobs pass successfully and repo.git is purged from gitlab.example
- We create again the same project on our test gitlab.example
- Push fails with unclear message: git push -u origin --all
we see the following error:
Enumerating objects: 1775221, done.
Counting objects: 100% (1775221/1775221), done.
Delta compression using up to 30 threads
Compressing objects: 100% (605123/605123), done.
Writing objects: 100% (1775221/1775221), 714.07 MiB | 9.17 MiB/s, done.
Total 1775221 (delta 1148245), reused 1774835 (delta 1147906)
remote: Resolving deltas: 100% (1148245/1148245), done.
remote: Checking connectivity: 1775221, done.
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual “git lfs push --all”.
To gitlab.example:namespace/repo.git
! [remote rejected] branch1 -> branch1 (pre-receive hook declined)
…
…
! [remote rejected] branchN -> branchN (pre-receive hook declined)
error: failed to push some refs to ‘git@gitlab.example:namespace/repo.git’
We investigated server logs and also tried push command with GIT_CURL_VERBOSE=1
and GIT_TRANSFER_TRACE=1
in addition to GIT_TRACE=1
, but this did not help in identifying the root cause.
it is really strange that the first time you can push your repository, then if you want to delete it on your gitlab instance and push it again, it fails.
Your help and tips are welcome.