从旧的LFS repo迁移到新的LFS repo? [英] Migrate from old LFS repo to new LFS repo?

查看:382
本文介绍了从旧的LFS repo迁移到新的LFS repo?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Bitbucket服务器上托管着LFS git存储库。现在,我们需要创建新的LFS仓库,并使用LFS存储将仓库移动到那里。



如何做到这一点?






例如,对于正常的回购,我们可以这样做:

  git remote添加新NEW_REMOTE_REPO_URL 
git push --all NEW_REPO_URL

是否将LFS存储与所有历史记录一起创建用于新回购?

解决方案


  git remote add new NEW_REMOTE_REPO_URL 
git push --all NEW_REPO_URL


基本上可以这样做你想要,但如果你没有在本地缓存所有的lfs数据,它会失败。为了得到它,你应该在你的命令之前运行:

  git lfs fetch --all 

PS:您也可以运行 git lfs push --all new 来只推送lfs数据,但是 git push 如果设置了预推送钩子,它们也会推送它们。 $ b

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?

解决方案

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

这篇关于从旧的LFS repo迁移到新的LFS repo?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆