在一个git存储库中维护不相关的目录 [英] Maintaining unrelated directories in one git repository

查看:118
本文介绍了在一个git存储库中维护不相关的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将两个或多个目录合并到一个git存储库中。这些存储库是逻辑链接的,但属于不同的文件系统路径,例如 / etc / httpd / var / named / chroot / var / named 都包含我想作为整体管理的虚拟主机数据,但我无法将它们链接在一起。



问了git邮件列表,但

建议?




更新:我没有使用这种机制来部署代码,我只是发现它是一个非常方便的方式:




  • 跟踪随着它们的变化而变化,以便我可以非常轻松地将 git checkout 添加到之前已知的稳定点和事件 git bisect 配置中问题。

  • 在单独的目录中暂存更改,然后在执行更改时从该目录中提取。



I'd like to combine two or more directories in one git repository. These repositories are logically linked but belong to different filesystem paths, e.g. /etc/httpd and /var/named/chroot/var/named both contain virtual host data which I'd like to manage as a whole, but I can't link them.

I've asked the git mailing list but had no luck.

Suggestions?


Update: I don't use this mechanism for deploying code, I just find it's a very convenient way of :

  • tracking changes as they happen, so that I can very easily git checkout to a previous known stable point and event git bisect configuration problems.
  • staging changes in a separate directory and then pulling from that directory when the time has come to perform the change.

解决方案

Perhaps you could set up a Git repository with multiple disjoint branches, one for each distinct directory tree you want to track. I'm not sure whether this arrangement would satisfy all your requirements, but it would allow you to keep the different directories in the same repository.

这篇关于在一个git存储库中维护不相关的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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