Reputation: 18268
I'm confused on what you do when you've created your own project repo, and then I want to add another repo to it like Laravel 4. It seems from Git Pro that submodules might be what I want, and if it is the way to do this will conflict arise with regards to similarly named files like readme.md? Is this what I'm looking for or is there another solution?
UPDATE: Currently I'm cloning laravel into my /root, then deleting the associated .git folder, then cloning our base installation files that include package.json, bower.json, /docs, /config/, etc etc etc; into my /root, deleting that .git folder, then invoking composer install and npm install, running git init, and finally pushing it the projects remote git repo on BitBucket. The deleting of .git for each cloned repo seems weird (which started this question), so I thought submodules after some searching, but submodules install to subfolders, which I don't want since that doesn't allow for all the CLI to be at a single level, among other things.
Upvotes: 1
Views: 1127
Reputation: 1324937
You shouldn't need submodules.
Once Laravel is installed, you can follow this Laravel recipe to manage your application with Git, provided your application is a Laravel project.
laravel:~$ cd myapp
laravel:~/myapp$ git init
Notice the file composer.lock is not tracked? You should edit
.gitignore
and removed the line that hascomposer.lock
in it. This way you'll be trackingcomposer.lock
too.When you track
composer.lock
with your source code control system it allows you to do acomposer update
on your development machine and then, later, acomposer install
on your production machine.
Thecomposer install
command will make sure all packages are the correct version as specified in thecomposer.lock
file. Thus production uses not only the same packages, but the same versions of the packages as your production machine
laravel:~/myapp$ git config --global user.email "[email protected]"
laravel:~/myapp$ git config --global user.name "Your Name"
laravel:~/myapp$ git add .
laravel:~/myapp$ git commit -m "initial checkin"
Upvotes: 2