Bare with the following, as I tried to think of a simple example and a common web structure came to mind. If the structure is like this:
/www
|-- scripts
|-- js
`shared_code.js
`-- css
`shared_style.css
|-- images
`-- cgi-bin/
|-- projectA
|-- .git
|-- foo.php
`-- foo.pl
`-- projectB
|-- .git
|-- bar.php
`-- bar.pl
Is it possible to add the js/css scripts to the git repositories?
It's not possible to do what you're asking (and it's quite inadvisable anyway). However, you might look into submodules. Your projectA
and projectB
would contain a submodule called scripts
. Of course that means you'll have to make scripts
into its own repository, but that's probably a good thing. You can read up on submodules here:
.git
directory must be at the top level of your project directories (in this casewww
). Recommend you create a.git
underscripts
and then turn thewww
directory into the main repo for the three submodules - NoName 2012-04-05 19:57