Setting up a project directory structure for git repo of a website
Asked Answered
M

1

3

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

Middleton answered 28/10, 2010 at 4:14 Comment(0)
A
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?

Agley answered 28/10, 2010 at 7:10 Comment(5)
My current repository doesn't have the same structure as the website because I had been only re-visioning my custom code. Is it possible for me then to change the directory structure of the repository while still keeping my repository history in tack?Middleton
Why not carry on keeping just your custom code in the repository? I don't see why changing your versioning system requires that to change.Agley
I guess I'm confused about how tar works. I'm assuming that the same directory structure is required for what is being un-tarred to where it's going. Is that wrong?Middleton
That is how tar works, but if your git repo is sturcuted the same as your svn repo, you can extract in the same way. Prehaps if you post the layout of your repos in the question I can do a more specific way.Agley
OMG I just realize git-archive is way more powerful than I had imagined. I can actually just archive part of the tree structure. That would totally solve my problem. :) Thanks! git archive <tree-ish> > my_new_archive.tarMiddleton

© 2022 - 2024 — McMap. All rights reserved.