你可以共享一个文件,它是两个git存储库之间的历史记录吗? [英] Can you share a file and it's history between two git repositories?

查看:107
本文介绍了你可以共享一个文件,它是两个git存储库之间的历史记录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定这是否可行,但我希望能够拥有一个文件并将其用于保存在git repostories中的两个项目中。这样,如果我在一个项目中进行更改,另一个项目将在文件被提取时接受更改。理想情况下,该特定文件的历史记录会显示来自两个项目的所有更改。



其他所有内容都将保持独立。 h2_lin>解决方案

git submodule 命令可以为您提供部分的功能,但它需要额外的步骤来保持文件同步。


I'm not sure if this is possible but I'd like to be able to have a single file and use it in two projects saved in git repostories. Such that, if I make a change in one project the other one would pick up that change when the file was pulled. Ideally the history of that particular file would show all the changes from both projects.

Everything else would remain separate.

解决方案

git submodule command can give you part of the functionality but it requires additional steps to keep the file in sync.

这篇关于你可以共享一个文件,它是两个git存储库之间的历史记录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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