为网站的 git repo 设置项目目录结构 [英] Setting up a project directory structure for git repo of a website

查看:35
本文介绍了为网站的 git repo 设置项目目录结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

注意:

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

我确实在@Charles Bailey 在他对 how-to-do-a-git-export-like-svn-export".

真正的问题变成了:

<块引用>

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


我没有仔细研究 git-archive 概要:

git archive [--format=] [--list] [--prefix=

/] [][-o |--output=] [--worktree-attributes][--remote=<repo>[--exec=<git-upload-archive>]] <tree-ish>[小路...]

[path] 显然意味着我可以归档"存储库的任何部分.我很困惑,因为我错误地认为我只能归档整个存储库.因此,这种方法将替代我在 SVN 中能够做的事情.:)

解决方案

应该没有什么能阻止您使用 git 处理 dame 目录结构做一个git export"(如svn export")? 展示了如何从 git 导出.您是否还有其他一些您认为无法做到的细节?

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. :)

解决方案

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?

这篇关于为网站的 git repo 设置项目目录结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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