问题
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. :)
回答1:
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?
来源:https://stackoverflow.com/questions/4039700/setting-up-a-project-directory-structure-for-git-repo-of-a-website