I want to clone https://github.com/getyouridx/pychargify into my django project, and will need to pull updates from time-to-time.
Just for clarification, could I simply write a gitignore from the root directory of the django project e.g. .gitignore: pychargify/.git
or are there other pitfalls I should be aware of?
Just for the record, you can clone a git repo within another one: Everything under your lib directory will be ignored by the enclosing Git repo, because said lib directory contains a . git . That means cloning the enclosing repo, and you will get an empty " lib/ " folder.
Git allows you to include other Git repositories called submodules into a repository. This allows you to track changes in several repositories via a central one. Submodules are Git repositories nested inside a parent Git repository at a specific path in the parent repository's working directory.
To have one git repo "inside" another, look at git submodules: http://git-scm.com/book/en/Git-Tools-Submodules
By making pychargify a submodule of your django project, specific revisions of your django project can be associated with specific revisions of your pychargify project. That can be really useful.
I'm not sure exactly what the dangers are of the approach you describe, but it doesn't pass the smell test for me. I would recommend using the Git feature (submodules) that is designed specifically for this type of thing.
Git has a feature for having a repository within another: submodules.
git submodule add https://github.com/getyouridx/pychargify.git
Be sure to read the entire documentation on submodules, as there as a few quirks involved with using them, and additional steps that need to be taken when doing a fresh clone of your own repository to initialize the submodules.
Also note that all submodule commands must be done in the root directory of your repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With