I've duplicated a repo into a newer repo but when doing a git clone on the new repo it's unable to download the files using the LFS pointers and I get an error when smudge is used... e.g... "Error downloading object. Object not found on server"
Steps:
git clone --bare https://github.com/myuser/old-repo.git
cd old-repository.git
git push --mirror https://github.com/myuser/new-repo.git
git clone https://github.com/myuser/new-repo.git
[error.....git-lfs.exe smudge --- somefile.....Error downloading object]
The branches and commit histories look fine but LFS fails to download the required files. Is there another method when using git-lfs?
Once Git LFS is installed, you can clone a Git LFS repository as normal using git clone . At the end of the cloning process Git will check out the default branch (usually main ), and any Git LFS files needed to complete the checkout process will be automatically downloaded for you.
Git LFS is a Git extension used to manage large files and binary files in a separate Git repository. Most projects today have both code and binary assets. And storing large binary files in Git repositories can be a bottleneck for Git users. That's why some Git users add Git Large File Storage (LFS).
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under "Danger Zone", click Transfer. Read the information about transferring a repository, then type the name of the user or organization you'd like to transfer ownership of the repository to.
I found out this link: mirroring-a-repository-that-contains-git-large-file-storage-objects
It seems to exactly answer your question.
The important part you missed is the git lfs push/pull
:
git clone --bare https://hostname/exampleuser/old-repository.git
cd old-repository.git
git lfs fetch --all
git push --mirror https://hostname/exampleuser/new-repository.git
git lfs push --all https://github.com/exampleuser/new-repository.git
Hooks and addons and such are repo-local config, if your git-lfs setup is somehow tricky to do a second time commit a repo-setup script to do it and run that on first checkout.
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