为网站的 git repo 设置项目目录结构

发布于 2024-09-29 02:23:19 字数 1114 浏览 1 评论 0原文

我正在开发一个 drupal 网站。我一直保留着自定义模块的 svn 存储库,最近我将其移植到 github 以便与其他开发人员合作。

来自 SVN,我习惯于直接从 SVN 存储库更新暂存网站上的自定义模块文件夹。但根据我所读到的内容(如果我错了请纠正我),这个工作流程在 Git 中是不可能实现的。

为 drupal Web 项目设置存储库的推荐方法是什么?我是否应该将整个站点放入一个受修订控制的项目中(drupal 核心和贡献的模块以及任何自定义代码)。或者我可以继续仅将自定义代码置于修订控制之下吗?

注意:

我当前存储库的目录结构与网站的结构不同,因为我只是重新设计了我的自定义代码。

我确实在 @Charles Bailey 在他对 “如何做-a-git-export-like-svn-export”

那么真正的问题就变成了:

我是否可以更改存储库的目录结构,同时仍保持存储库历史记录完好无损?


我没有足够仔细地查看 git-archive 概要:

git archive [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>]
                     [-o | --output=<file>] [--worktree-attributes]
                     [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish>
                 [path...]

<树型> [path] 显然意味着我可以“归档”存储库的任何部分。我很困惑,因为我错误地假设我只能归档整个存储库。因此,这个方法将取代我在 SVN 中能够做的事情。 :)

I'm working on a drupal website. I've been keeping an svn repository of my custom modules which I've recently ported to github to work with another developer.

Coming from SVN I'm used to just being able to update my custom modules folder on the staging website directly from my SVN repository. But from what I've read (correct me if I'm wrong please) this workflow is not possible with Git.

What is the recommend way of setting up a repository for a drupal web project. Should I be putting the whole site into one project that's under revision control (drupal core and contributed module as well as the any custom code). Orm can I continue to only keep the custom code under revision control?

Note:

The directory structure of my current repository doesn't have the same structure as the website because I had been only re-visioning my custom code.

I did see the possibility for me in the suggestion by @Charles Bailey in his answer to "how-to-do-a-git-export-like-svn-export".

The real question then becomes:

Is it possible for me to change the directory structure of the repository while still keeping my repository history intact?


I hadn't taken a close enough look at the git-archive synopsis:

git archive [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>]
                     [-o | --output=<file>] [--worktree-attributes]
                     [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish>
                 [path...]

the <tree-ish> [path] clearly means that I can 'archive' any part of the repository. I was confused because I had wrongly assumed that I could only archive the whole repository. Thus this method will substitute what I was able to do in SVN. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泡沫很甜 2024-10-06 02:23:19

应该没有什么可以阻止您使用 git 处理 dame 目录结构
执行“git 导出”(如“svn 导出”)? 显示如何从 git 导出。
您还有其他您认为无法做到的细节吗?

There should be nothing stopping you from working with the dame directory structure with git
Do a "git export" (like "svn export")? shows how to export from git.
Do you have any other specifics that you think you can't do?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文