Migrate from old LFS repo to new LFS repo?

你离开我真会死。 提交于 2019-12-05 22:13:43

问题


There is LFS git repository hosted at Bitbucket server. Now we need to create new LFS repo and move repository there with LFS storage.

How to do this?


For example for normal repo we can do:

git remote add new NEW_REMOTE_REPO_URL 
git push —-all NEW_REPO_URL

Will LFS storage be created with all history for new repo?


回答1:


git remote add new NEW_REMOTE_REPO_URL 
git push —-all NEW_REPO_URL

Basically yes this will do what you want, but it would fail if you don't have all lfs data cached locally. To get it you should run before your commands:

git lfs fetch --all

PS: you could also run git lfs push --all new to only push lfs data, but git push will push them also, if the pre-push hook is set up




回答2:


You can modify the lfs endpoint in your local repo by doing something like: git config lfs.url = "https://my_other_server.example.com/foo/bar/info/lfs"

If you need it to stick in the repository, they recommend: git config -f .lfsconfig lfs.url https://my_other_server.example.com/foo/bar/info/lfs git add .lfsconfig

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



来源:https://stackoverflow.com/questions/40366931/migrate-from-old-lfs-repo-to-new-lfs-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!