Take the 2-minute tour ×

I'm starting work on an old codebase, which is on a production server. I need to make a local duplicate, so I think the sensible thing to do is the following:

cd docroot
git init
git add .
git commit -m "Files before I started work"
git push origin // github account

and then clone the repo to my dev box. However, some of the subfolders on the production server are separate git repos for various plugins that have been developed. Will this make a mess of the main repo I'm creating? I'd ideally like to have them as submodules, but how do I sort out the init process without disturbing the production files?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Before adding "everything", you could create a .gitignore file in order to reference the path of the sub-directories which are actually git repos.
They won't be added.

That way:

  • you first commit will represent only what you need (ie not the submodules)
  • you can reference later the subrepos as submodule in your local clone of that new repo.
share|improve this answer
add comment

Your Answer


