With Git, I'd like to include some common JS/CSS library and/or utility methods (i.e. specific files from another repo) in my project, and I'd like it so they're always up-to-date. I don't really want the entire remote repository(s). Bonus if I can work on my "local copies" of the remote files and push the changes back up.

A somewhat parallel example: in ASP.NET, I would do this by referencing the ("remote") other libraries' .dll files (without "copy local"), so that whenever I recompile the external libraries my project would already point to the newest versions.

Example Scenario

My project is...MyProject, and I just want a couple files from external repositories ExternalLibrary and External2. I'd prefer not to clone each repository somewhere else and copy-paste the files into my repo. If I make an improvement to MyProject/scripts/common1.js, I'd like to push that back to ExternalLibrary.

  1. MyProject/
    • index.html
    • scripts/
      • mycode.js
      • otherplugin.js
      • common1.js <-- from ExternalLibrary
      • plugin2.js <-- from ExternalLibrary
    • styles/
      • mystyle.css
      • common.css <-- from External2
  2. ExternalLibrary/
    • common1.js
    • plugin1.js
    • plugin2.js
    • bunchofothercrap...
  3. External2/
    • common.css
    • bunchofothercrap...

Related references:

Edit
Report