Take the 2-minute tour ×

I'd like to maintain a mirror version of Twitter's Bootsrap for my development environment. Now I'm not interested in polluting my work directory with all the contents of Bootstrap. I rather only want to mirror certain directories in their appropriate places. Consider this example:

./myComputer              github.com/twbs/bootstrap
 + assets                 |
   + js                   |
   | + lib                |     
   |   + bootstrap   <--- + js/*
   + css                  |
   | + lib                |
   |   + bootstrap   <--- + less/*
   + fonts           <--- + fonts/*

This should be a basic downstream mirror. I don't expect git to keep track of my changes I make locally. I just want it to apply patches on a regular base. I've read Mirror a git repository by pulling?, but this method doesn't allow me to only pick certain direcotries to sync.

share|improve this question
add comment

1 Answer

The easiest way would be to:

  • git fetch upstream
    (with 'upstream' being a remote name for the github bootstrap repo)
    That fetches everything, but keep it in the remote namespace "remotes/upstream"

  • merge the folders that you want (as in "How do I merge a sub directory in git?"), with git read-tree.

share|improve this answer
add comment

Your Answer


