问题标签 [git-submodules]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
git - Git 子模块和状态队列
我在我的 vim 存储库中添加了两个子模块,并且 git status 命令总是输出以下内容:
我跑过:
并没有发生任何事情让它消失。有任何想法吗?
git - 每个 Zend Framework 模块的单独 Git 子模块?
我使用可重用模块(例如邮件模块、cms 模块等)开发了很多基于 Zend 框架的应用程序。
每个项目都有自己的集中存储库并使用一些通用模块。每次我更新其中一个项目中的模块时,很可能我也需要更新其他项目中的模块。
使这些可重用模块同步的最佳方法是什么?每个 Zend Framework 项目都需要 ~10 个 git 子模块吗?你的做法是什么?项目外每个模块的单独回购?
git - 仅来自另一个存储库的目录的 Git 子模块
是否可以创建一个不直接链接到存储库但链接到其中的目录的子模块?
例如,让 fw.git 成为一个框架存储库,具有以下目录:
我想子模块框架代码,只是code
目录,而不是其他目录。
git - Capistrano 食谱和其他杂项的 Git 回购结构
我的问题是我有一堆不同的 capistrano 食谱和代码片段,我在多个项目中使用它们。我的本地文件结构是一个名为 helper-snibbits 的文件夹,其下的文件夹名为 ./capistrano、./php-bits 和 .py-bits
我可以使用 repo 单独跟踪每个片段,但这在服务器和我的项目中变得难以管理。我更愿意为所有内容设置一个仓库。你认为最好的组织方式是什么?我喜欢子模块的工作流程,但据我所知,每个子模块都需要一个单独的仓库。真的吗?如果单独的回购是最好的方式,我最终会这样做。
git - 如何从父克隆中的过去提交中获取 git 子模块的关联提交 ID?
除了实际检查父提交之外,有没有办法根据父克隆中的提交 ID 确定子模块的 SHA-1 提交 ID?我知道我可以找到当前关联的 SHA-1 与git submodule
.
这是一个例子:
- 我有一个带有单个子模块的克隆,该子模块
foo
在上个月更改了几次。 - 我在几周前的父克隆中有一个标签,称为
released-1.2.3
. 我想找出foo
这个标记提交的相关 SHA-1 是什么。 - 我可以简单地检查
released-1.2.3
并使用git submodule
来查看,但我想知道是否有一种方法可以在不影响工作树的情况下做到这一点,因为我想编写脚本。
我想这样做是因为我想构建一个脚本来对父存储库中的两个提交之间的子模块内的所有更改进行“差异” - 即“告诉我在父存储库中的foo
这两个提交之间子模块内更改了哪些文件。 "
svn - How do I adapt my svn:externals strategy to git submodules?
I'm having trouble figuring out how to change my mindset to git and have run in to the following problem. I have the situation where we have a shared engine and multiple projects that use the engine. Internal development teams and second party teams may be working on projects that use the shared engine, and want to be using HEAD of the shared engine as much as possible during development, until just a few weeks before ship, where the shared engine will be tagged and branched, and the project will then use that branch. The project teams typically only work on one project at a time, but may make changes to the shared engine during debugging or to add features. When they commit those changes, our build system runs to find any problems they may have introduced with the commit.
I (think I) want to use this same model with a new project/new company. In svn, the structure was something like this: shared_engine
This worked very well:
- Project developers could do one command to check out all the dependencies they would need
- Project developers could do engine work and commit in to the shared engine easily
- We could easily rev or change the shared engine the project was using with externals and revisions
- Engine updates were easy to get with your daily "update from the root project"
OK, now I've moved to git, and submodules SEEM to be the new way to deal with external code, but it seems like I lose some features.
- It's a multiple step process to actually get all the dependencies of the project. Project developers have to do a git clone then a git submodule init/git submodule update --recursive
- It's a multiple step process to update the root project and the submodule, so if changes are made to the root project by another developer that match changes to the submodule, you don't get the matching code immediately and could get very confused
- The submodule is locked to a particular commit, and if you make changes to the submodule you will have trouble getting it to work with the head of the shared engine
- I have no control over what revision of the shared engine the project developer has checked out without giving instructions on what to update to
So my questions are as follows:
- First and foremost, are the above assumptions about submodules correct? It seems to be based on what I've read, but I'm not 100% certain as I'm still figuring out git
- If my assumptions are correct, am I approaching the problem with the correct process? Do I need to readjust my thinking when using git? In other words, is there another way to do what I'm trying to do and need to think about the process differently?
- Assuming I haven't blown the first two, and submodules won't do what I want, what will? I read about subtree merges but those don't seem exactly right either as it looks like I can't get changes made to the shared code back in to the repository.
Thanks so much for your help and patience. If it's not obvious, I'm very new to git, and I like it and want to embrace it, but I'm still having some conceptual misunderstandings because I've probably been brain damaged by years of using central repos. I want to learn! Also, I've been rtfm'ing all day, and looking at various blogs posts, stackoverflow questions, etc, and I still don't get it, I obviously need it spelled out step by step for my situation. I have no coworkers to ask about this, any user groups in the Seattle area where there might be some git gurus? :)
git - 将 git 项目(带有子模块)部署到 FTP 服务器的最佳方式
大家好。有 capistrano,但它只适用于 ssh 服务器,我们的很多客户都没有。我们还广泛使用 git 子模块。您知道将 git 项目(带有子模块)部署到 FTP 服务器的最佳方式是什么?
我已经尝试过 Beanstalk 和 Springloops v2,但它们都非常短。Beanstalk 经常失败,springloops v2 还在苦苦挣扎。
多谢你们。
git - 使用 Git 复制子模块
我在 Git 中有一个项目,它有几个子模块,我需要下载这些子模块和可用的文件才能使用主项目,为了使子模块工作,我需要它们自己的子模块可用等。所以为了设置它,我使用递归初始化子模块git submodule update --init --recursive
。
但是,我注意到我的许多子模块都有共享依赖项,在伪代码中看起来像这样(alpha -> beta
表示alpha
具有子模块beta
)
我的问题是:有没有什么方法可以避免这种重复只使用 git,同时仍然拥有每个子模块的文件(至少一个副本)?
我可以想象一个带有符号链接的解决方案,但如果 git 为我处理这个问题会更好,而且我不确定自己放入符号链接是否会在更新子模块时引起问题。
理想情况下,我很想将其简化为:
在此先感谢您的任何建议!