[英]Git Multi-Project files
I've started to use git to keep track of some of my scripts that are used across several projects. 我已经开始使用git来跟踪在多个项目中使用的一些脚本。 I don't have the complete projects on git, just the multi-project files.
我没有git上的完整项目,只有多项目文件。 I'm trying to get these files from git and have them update local instances of the file across the different projects.
我正在尝试从git获取这些文件,并让它们在不同项目中更新文件的本地实例。
For example: One of my scripts is a JavaScript InputManager. 例如:我的脚本之一是JavaScript InputManager。 This manager gets changed and updated in all different projects I'm working on, but all of them should have the latest version.
该经理在我从事的所有不同项目中都得到了更改和更新,但是它们都应该具有最新版本。
Is there any way to retrieve the latest version of the InputManager from git and update that version so it gets updated in my other projects too? 有什么方法可以从git中检索InputManager的最新版本并更新该版本,以便它也可以在其他项目中得到更新?
Thanks in advance. 提前致谢。
You have one local repository where you do your changes. 您在一个本地存储库中进行更改。 (And probably another "official" one where you push your changes to.)
(可能还有另一个“官方”用户将您的更改推送到。)
All your project contain another clone of the repository. 您的所有项目都包含该存储库的另一个克隆。 If you want to update such a repository you have to do a
git pull
in each of them. 如果要更新这样的存储库,则必须在每个存储库中进行
git pull
。
One options is to turn them into gems and use bundler in the other projects to pull the gem in. 一种选择是将它们变成宝石,并在其他项目中使用捆绑器将宝石拉入。
Making gems: http://guides.rubygems.org/make-your-own-gem/ 制作宝石: http : //guides.rubygems.org/make-your-own-gem/
Using bundler outside of rails: 在导轨外部使用捆绑器:
http://technotales.wordpress.com/2010/08/22/bundler-without-rails/ http://technotales.wordpress.com/2010/08/22/bundler-without-rails/
Bundler: how to use without rails? Bundler:如何在没有护栏的情况下使用?
Bundler itself: http://bundler.io/ Bundler本身: http : //bundler.io/
nb I don't normally post so many links but in this case the first line of my answer kinda says it all and can be regoogled. nb我通常不会发布太多链接,但是在这种情况下,我的回答的第一行会说明所有内容,并且可以重新搜索。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.