简体   繁体   English

Git Multi-Project文件

[英]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.

相关问题 Git组织为多项目团队 - Git organisation for a multi-project team 在Git中管理多项目分支 - Managing Multi-Project Branches in Git 将CVS多项目树层次结构转换为Git? - Converting CVS multi-project tree hierarchy to Git? 使用 reposurgeon 将多项目 Subversion 存储库迁移到 Git - Migrating a multi-project Subversion repository to Git with reposurgeon 将具有公共中继的多项目Subversion仓库迁移到Git? - Migrating a multi-project Subversion repo with a common trunk to Git? 将许多小型项目合并为一个多项目,同时保留Git的历史和分支 - Merging many small projects into one multi-project while keeping history and branches in Git 从SVN迁移到git以来,对多项目作业的SCM轮询不正确 - Incorrect SCM polling on multi-project job since migration from SVN to git VSCode多项目工作区:如何在工作区根目录下添加.gitignore等单个文件? - VSCode multi-project workspace: how to add individual files such as the .gitignore at the root of the workspace? 导入多项目SVN存储库不会导入所有使用svn copy创建的文件 - Importing multi-project SVN repository does not import all files created with svn copy 多项目,多用户自动部署 - Multi-project, multi-user automated deployment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM