简体   繁体   中英

git - how to mirror file from other repo

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM