Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maintaining unrelated directories in one git repository

Tags:

git

I'd like to combine two or more directories in one git repository. These repositories are logically linked but belong to different filesystem paths, e.g. /etc/httpd and /var/named/chroot/var/named both contain virtual host data which I'd like to manage as a whole, but I can't link them.

I've asked the git mailing list but had no luck.

Suggestions?


Update: I don't use this mechanism for deploying code, I just find it's a very convenient way of :

  • tracking changes as they happen, so that I can very easily git checkout to a previous known stable point and event git bisect configuration problems.
  • staging changes in a separate directory and then pulling from that directory when the time has come to perform the change.
like image 224
Robert Munteanu Avatar asked Jun 01 '09 07:06

Robert Munteanu


1 Answers

The best way to do this is to write a script that deploys the files, and use Git to manage the source for the project. If you have more sophisticated needs then management tools like Puppet integrate with version control.

Direct Git checkouts are not a good way to do deployment - it was not intended for this. You can avoid the issue of having repositories on target systems by using the export facility, but by design Git does not store full permission/ACL data for files.

like image 79
Stuart Ellis Avatar answered Oct 25 '22 03:10

Stuart Ellis