首页 \ 问答 \ 使用单个git存储库而不是子模块管理不同的代码库(Manage different codebases using single git repository instead of submodules)

使用单个git存储库而不是子模块管理不同的代码库(Manage different codebases using single git repository instead of submodules)

在阅读了关于子模块的这篇文章之后,它们似乎只存在于您自己的外部git存储库中。 但是,我希望子模块只允许您从一个存储库中管理多个单独的提交历史记录。

是否有可能拥有非外部git存储库? 我想在一个存储库下管理我的所有厨师烹饪书,每个存储库都有单独的提交历史记录,而不需要创建一堆git存储库

编辑:我认为我的用例并不清楚。 我的意思是我希望在每个服务器上都有唯一可寻址位置的食谱清单 ; 不是我想要个人食谱的子模块。 在这种情况下,mu的答案非常有效地解决了这个问题。


After reading this article on submodules, it seems like they exist only to link to external git repositories from within your own. However, I am expecting submodules to simply allow you to manage multiple, separate commit histories from within one repository.

Is it possible to have non-external git repositories? I'd like to manage all of my chef cookbooks under one repository with separate commit histories for each, without needing to create a bunch of git repos

EDIT: I don't think I made my use case clear. What I meant was that I wanted to have the list of cookbooks for each of my servers in uniquely addressable places; not that I wanted a submodule for an individual cookbook. In this case, mu's answer addresses the problem quite effectively.


原文:https://stackoverflow.com/questions/28031922
更新时间:2023-07-23 18:07

最满意答案

好吧,如果你正在寻找客户端实现,我建议使用Fancybox: http ://fancyapps.com/fancybox/这个库很强大,但它很容易使用。

如果您正在寻找卷轴,请尝试使用FlexSlider: https//github.com/woothemes/FlexSlider

更新

以下是如何在rails应用程序中使用Fancybox显示照片(从我的工作应用程序中获取)的示例:

在javascript文件夹中有两个文件:jquery.fancybox.pack.js和jquery.fancybox-buttons.js(因为我还需要为我的图库使用控制按钮)。 我也有MouseWheel库,但这个是可选的。 在application.js中(当然,你可以有其他库):

//= require jquery
//= require jquery_ujs
//= require jquery.ui.all
//= require lib/jquery.mousewheel
//= require lib/jquery.fancybox.pack
//= require lib/jquery.fancybox-buttons

jQuery(function($) { // as soon as DOM is ready
$(".fancybox").fancybox({ // initialize fancybox on all pages where it is present
        helpers: {
            title: {type: 'inside'},
            buttons: {}
        }
    });
});

另外,不要忘记下载FancyBox样式并将其包含在application.css中。

在我看来:

<% photos.each do |photo| %>
<%= link_to image_tag(photo.file.thumb('200x200#').url),
                photo.file.remote_url,
                class: 'fancybox', rel: 'group', title: photo.title, alt: 'Photo' %>
  <% end %>

Well, if you are looking for a client-side implementation, i would recommend using Fancybox: http://fancyapps.com/fancybox/ This library is powerful, yet it is easy to use.

If you are looking for a scroller, try using FlexSlider: https://github.com/woothemes/FlexSlider

update

Here is an example of how you can use Fancybox in rails app to display photos (taken from my working app):

In javascript folder there are two files: jquery.fancybox.pack.js and jquery.fancybox-buttons.js (because i also needed to use control buttons for my gallery). Also i have MouseWheel library, but this one is optional. In application.js (of course, you can have other libraries):

//= require jquery
//= require jquery_ujs
//= require jquery.ui.all
//= require lib/jquery.mousewheel
//= require lib/jquery.fancybox.pack
//= require lib/jquery.fancybox-buttons

jQuery(function($) { // as soon as DOM is ready
$(".fancybox").fancybox({ // initialize fancybox on all pages where it is present
        helpers: {
            title: {type: 'inside'},
            buttons: {}
        }
    });
});

Also do not forget to download FancyBox styles and include it in your application.css.

In my view:

<% photos.each do |photo| %>
<%= link_to image_tag(photo.file.thumb('200x200#').url),
                photo.file.remote_url,
                class: 'fancybox', rel: 'group', title: photo.title, alt: 'Photo' %>
  <% end %>

相关问答

更多
  • 关于Ruby[2022-10-11]

    Ruby on Rails是一个用于编写网络应用程序的框架,它基于计算机软件语言Ruby,给程序开发人员提供强大的框架支持。Ruby on Rails包括两部分内容:Ruby语言和Rails框架。 什么是Ruby? Ruby 语言是一种动态语言,它与Python、Smalltalk和Perl这3种编程语言有些类似。Ruby语言起源于日本,它的研发者是日本人松本行弘(Matsumoto Yukihiro)。松本行弘在1993年开始着手Ruby语言的研发工作,他开发Ruby语言的初衷是为了提高编程的效率。 19 ...
  • Ruby on Rails是一个 Web 应用程序框架,是一个相对较新的 Web 应用程序框架,构建在 Ruby 语言之上。它被宣传为现有企业框架的一个替代,而它的目标,简而言之,就是让生活,至少是 Web 开发方面的生活,变得更轻松。 J2EE是一种利用Java 2平台来简化企业解决方案的开发、部署和管理相关的复杂问题的体系结构。J2EE技术的基础就是核心Java平台或Java 2平台的标准版,J2EE体系结构提供中间层集成框架用来满足无需太多费用而又需要高可用性能高可靠性以及可扩展性的应用的需求。 ...
  • 我看到两个问题:缺少SQL索引,以及对Post.all调用Post.all 。 您的缓慢查询涉及WHERE published = ? 。 如果posts.published未编入索引,则必须扫描整个表格,而不仅仅是已发布的文章。 你也倾向于通过posts.published_at进行排序, posts.published_at没有索引,这也会很慢。 要解决此问题, posts.published_at在迁移中的posts.published和posts.published_at上添加索引。 add_ind ...
  • 这不是一个真正的Rails问题。 这是你使用Ruby做的事情,然后可能使用Rails,或Sinatra或Padrino显示 - 选择你的毒药。 您可以使用几种不同的HTTP客户端: Open-URI附带Ruby,是最简单的。 Net :: HTTP附带Ruby并且是标准的工具箱,但它是较低级别的,所以你必须做更多的工作。 HTTPClient和Typhoeus + Hydra能够进行线程化并具有高级和低级接口。 我建议使用Nokogiri来解析返回的HTML。 它功能齐全,功能强大。 require 'no ...
  • 你可以确定一个引擎。 引擎是独立的应用程序。 特别是如果你使用isolate_namespace指令,引擎在“主”应用程序上的isolate_namespace很少。 您可以使用main_app引用它,但最终它将是自包含的: #lib/game/game.rb module Game class Engine < ::Rails::Engine isolate_namespace Game #-> url.com/game end end 这与路径文件中“命名空间”的作用几乎相同 ...
  • 正如@Blender所提到的,rails附带了一个名为webrick的内置Web服务器。 (想想它和apache一样..现在) 所以你要做的就是转到rails项目目录,然后运行命令 如果您使用rails <3.x ruby script/server 如果您使用rails> 3.x rails server 一旦你完成了这个,你的rails项目将在webrick服务器中启动,默认情况下在端口3000中启动 http://localhost:3000 你可以考虑apache /其他一些rails服务器设 ...
  • 请按照本文中的步骤操作,尤其是他们注意到,更好的位置为sqlite dll位于ruby bin目录中。 将它放在那里也可能有助于获取已加载的版本的排序顺序。 否则,我会做一个宝石卸载sqlite3-ruby,然后重新安装它。 Try following the steps in this article, in particular they note that a better location for the sqlite dll is in the ruby bin directory. Placin ...
  • 在application.html.erb中查找: <%= debug(params) if Rails.env.development? %> or <%= debug(params) %> 这是显示所有这些信息并在需要时将其删除的代码,但如果条件存在,它可能只在开发环境中显示。 Look for this in your application.html.erb : <%= debug(params) if Rails.env.development? %> or <%= debug(params) ...
  • 好吧,如果你正在寻找客户端实现,我建议使用Fancybox: http ://fancyapps.com/fancybox/这个库很强大,但它很容易使用。 如果您正在寻找卷轴,请尝试使用FlexSlider: https : //github.com/woothemes/FlexSlider 更新 以下是如何在rails应用程序中使用Fancybox显示照片(从我的工作应用程序中获取)的示例: 在javascript文件夹中有两个文件:jquery.fancybox.pack.js和jquery.fancy ...
  • 这取决于你想要什么,你拥有什么以及你想要它。 Wordpress被认为是一个博客CMS,但它非常灵活,你甚至可以将它用于网络应用程序。 (当然你需要在php中编写你的插件)。 如果您只想拥有一个简单的网站而且技术上不太倾向于我,那么我会说Wordpress是Go-to平台。 如果您有时间,认真考虑网络应用程序,Rails是一个非常先进的Web应用程序框架,绝对值得一试。 真的,这取决于。 It really depends on what you want, what you have and how yo ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)