Using Bootstrap as a git submodule

Bootstrap, from Twitter is a powerful framework and get updated often, here is a quick way to integrate it as a git submodule in any project.

Install dependencies

To make bootstrap from source, some dependencies are needed, assuming you have node.js and npm installed, you need to install uglify-js and less.

$ sudo npm install uglify-js -g
$ sudo npm install less -g

Create the git submodule

In your existing git repository.

$ git submodule add
$ git add .gitmodules bootstrap
$ git commit -a -m "Added bootstrap submodule"
$ git submodule init
$ git submodule update

Then, after cloning the repository, you can update the submodule.

$ git submodule init
$ git submodule update

More informations on git submodule are available on the Git Community Book

Make bootstrap

In the bootstrap directory, you just need to run make bootstrap.

$ make bootstrap

Then you can move the bootstrap folder to you asset fodler.

$ rm -rf ../static/bootstrap
$ mv bootstrap ../static

And you ?

Any tips using bootstrap as a git submodule ?

You should follow me on Twitter

Share this article

Tip with Bitcoin

Tip me with Bitcoin and vote for this post!


Leave a comment

© Thomas Sileo. Powered by Pelican and hosted by DigitalOcean.