4

My team and I are currently working on a django app. We want to keep track of changes to the django project files on a private repo (so that all of the private information is not available) as well as open source the app files on github.

Currently we have two repos:

1) A repo for the project that contains:

 /Main Folder
  |- .git
  |- /djangoproject
  |- requirements.txt
  |- dev-db.sqlite
  |- manage.py
  |- .gitignore

The git ignore is told to ignore the second repo which is the app repo and also resides in Main Folder:

2)

/Main Folder
  |- /django-app-name // the name of the repo as appearing on github
      |- .git
      |- /djangoapp
          |- models.py
          |- urls.py
          |- views.py
          |- admin.py
          |- ....
      |- .gitignore
      |- LICENSE
      |- README.md
      |- requirements.txt

This works for our purposes, but it would be really nice to somehow consolidate the two repos so that a single command would work with both. I am just getting started with git, so I don't know all of the awesome features that git contains. Is there a way to be able to track both the private and public portions of the whole django project within a single repo? What is the best way, using git, to have private project settings and an open source app?

OozeMeister
  • 4,638
  • 1
  • 23
  • 31
  • Use branches, and push one and not the other? – hd1 Nov 15 '12 at 17:15
  • If I were to use branches, would that not allow me to be able to have the project and the app at the same time so that I could develop on it? Meaning: one branch would contain the project and the other would not? Do you have any examples on how this could be implemented? – OozeMeister Nov 15 '12 at 18:01
  • Actually, reading on submodules at @Nezo's link, it seems to be the way to go, my apologies. – hd1 Nov 15 '12 at 18:05

1 Answers1

1

As far as I know, the best way to do this is to have a git submodule.

Have look at how git submodules work : http://git-scm.com/book/en/Git-Tools-Submodules

Nezo
  • 312
  • 3
  • 14