Migrate from an old LFS repository to a new LFS repository?

There is an LFS git repository hosted on a Bitbucket server. Now we need to create a new LFS repo and move the repository there with the LFS repository.

How to do it?


For example, for a normal repo, we can do:

git remote add new NEW_REMOTE_REPO_URL 
git push —-all NEW_REPO_URL

Will an LFS repository be created with all the history for the new repo?

+4
source share
2 answers
git remote add new NEW_REMOTE_REPO_URL 
git push —-all NEW_REPO_URL

Basically yes, it will do what you want, but it will fail if you do not store all the local lfs data locally. To get it, you must do before your commands:

git lfs fetch --all

PS: git lfs push --all new, lfs, git push , pre-push hook

+4

lfs , - : git config lfs.url = "https://my_other_server.example.com/foo/bar/info/lfs"

, , : git config -f .lfsconfig lfs.url https://my_other_server.example.com/foo/bar/info/lfs git add .lfsconfig

. https://github.com/github/git-lfs/wiki/Tutorial#lfs-url

-1

Source: https://habr.com/ru/post/1659552/


All Articles