When I create a new project, I usually do a git init
in the project directory and then download the source of whatever framework I'm using (FuelPHP, django, etc) and copy it over to the project directory. This way, I don't have two sets of git information.
This sucks because it isn't easy (I can't just git clone
) and upgrading is more of a chore.
What is the best way to manage this? Should I set a new remote
within git after I create the project directory? Something like:
cd project_dir
git init
git remote add origin GITHUB_URL
git remote add fuelphp FUEL_GITHUB_URL
git pull fuelphp master
git add .
git commit -m 'adding fuel'
git push origin master
Or is this considered bad practise?
If you manage your project in git and the "framework" is managed in git, too, then you have different possibilities:
git submodule
to include the other repository. (In your project you basically store a pointer to a commit in the framework repository.)git subtree
this pretty much integrates the commits of the framework into your project and allows easy upgrades.You have to find out which way is best for your situation.
You can find a nice article on the topic here.