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

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

问题描述

我正在一个drupal网站上工作。我一直在保存我最近移植到github的另一个开发人员的自定义模块的svn存储库。



来自SVN我习惯了能够直接从我的SVN信息库更新分段网站上的自定义模块文件夹。但是从我读过的内容(如果我错了,请纠正我)这个工作流程是不可能的。Git。



建立一个存储库的建议方法是什么为一个drupal网络项目。我应该将整个网站整合到一个正在进行版本控制的项目(drupal core和贡献模块以及任何自定义代码)中。 Orm可以继续保留自定义代码的版本控制吗?



注意:



我目前的存储库与网站没有相同的结构,因为我只是重新考虑了我的自定义代码。



@Charles Bailey在回答 如何做-DO-A-混帐出口类 - svn的出口



真正的问题是:


我修改存储库的目录结构,同时仍保持我的存储库历史不变?







我没有足够仔细地查看git-archive简介:

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

< tree- ISH> [路径] 清楚地表示我可以归档存储库的任何部分。我很困惑,因为我错误地假定,我只能存档整个存储库。因此,这种方法将替代我在SVN中所能做的。 :)

解决方案

应该没有什么可以阻止你使用dame目录结构与git
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天全站免登陆