git - how to mirror file from other repo

只谈情不闲聊 提交于 2019-12-12 22:30:06

问题


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.

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.

Any help is really appreciated


回答1:


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).



来源:https://stackoverflow.com/questions/7427413/git-how-to-mirror-file-from-other-repo

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