4

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.

Community
  • 1
  • 1
buschtoens
  • 8,091
  • 9
  • 42
  • 60

1 Answers1

0

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250