A remote repository (origin @ BitBucket) got deleted. I have a local version of that project and I'm trying to recreate this repository from my local copy.
The deleted project used LFS. I have created a new empty repository on GitLab and added it as a secondary remote named "origin2".
When I try to do git push origin2 master
my upload process gets stuck at Uploading LFS objects: 50% (2553/5107), 783 MB | 0 B/s
I tried to do git push origin2 master --no-verify
and this worked. But if I now clone this new repository from GitLab and try to open the project I get all kinds of errors which I assume is because some files previously "handled" by LFS are missing.
Is there a way I can fully recreate the repository from my local copy?
This is how my config looks:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = [email protected]:company/project.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[lfs "https://bitbucket.org/company/project.git/info/lfs"]
locksverify = false
[remote "origin2"]
url = [email protected]:company/project.git
fetch = +refs/heads/*:refs/remotes/origin2/*
[lfs "https://gitlab.com/company/project.git/info/lfs"]
locksverify = true
If you don't have all of the LFS objects on the original server, then you have lost data. Unlike the Git data, the entirety of the LFS data is not stored in your local repository and is typically only stored on the server.
The pre-push
hook, which is skipped with --no-verify
, is where LFS files are typically pushed, which is why pushing this way seems to work.
The proper way to push LFS objects to a new location is to fetch them with git lfs fetch --all
and then push with git lfs push --all NEW-REMOTE
. However, if you have no way to fetch the old data, then it's just gone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With