git - 如何从其他仓库镜像文件 [英] git - how to mirror file from other repo

查看:46
本文介绍了git - 如何从其他仓库镜像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可能无法解决的问题,但我还是会问.我确实有一个 git 存储库,我需要从另一个文件镜像一个文件.我需要在我的存储库中拥有一个 .xsd 文件.

I've a problem which probably can't be solved, but I'll ask anyway. I do have one git repository, and I need one file to be mirrored from another one. There is one .xsd file in the repo I need to have in my repository.

这不是最大的问题.我想将该文件(例如在 git fetch 上)更新为包含 .xsd 文件的存储库上最后一个标记的版本.

That's not the biggest problem. I want to update that file (on git fetch for instance), to the version of the last tag on the repository containing .xsd file.

非常感谢任何帮助

推荐答案

你可以使用 post-checkout (或者更合适的)钩子将文件的最新版本替换为你想要的任何版本需要,但是您将有一个未提交的文件.如果你需要的话,你可以在钩子中提交它(或者如果它没有被跟踪,就不会有问题,如果没有看到问题的更多细节就很难说).

You can use post-checkout (or maybe some more appropriate) hook to replace the latest version of the file with any version you need, but then you will have an uncommitted file. You can commit it in the hook if you need that though (or if it is not tracked, there will be no problems, it's hard to say without seeing further details of the question).

这篇关于git - 如何从其他仓库镜像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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