0

I want to create a git repo that will include scripts in /nfsdrive/sbin/ and the services that activate these scripts—which reside in /etc/init.d/.

I've searched the documentation and the relevant discussions, but could not find if the above is at all possible, much less how to accomplish it.

Is it possible to create a git repo that will comprised of files residing in NFS and files in a system directory?

3

1 Answer 1

3

This seems like a question about how to use a tool, but I will attempt a conceptual answer anyhow.


Instead of creating your git repository using the same file structure as a real server, consider storing the files all in one folder, but arranged into sub folders to represent where they should go. You could include a shell script that acts as an installer.

Basically, Git is good at storing files and version control, but not good at deployment. This is why version control and the logic for deploying code and configuration are their own specialized tools.

An idea for the structure of the repository could be:

./nfsdrive/sbin/
./etc/init.d/
./install.sh

If in your home directory, a git clone <your repo> would result in this file structure:

/users/boardrider/<your repo>/nfsdrive/sbin/
/users/boardrider/<your repo>/etc/init.d/
/users/boardrider/<your repo>/install.sh

Then you can execute install.sh with root permissions. This shell script could simply copy the files in <your repo> to their respective locations on the real machine.

It is a good idea to separate the storage of code from the logic that deploys it. This allows you to use specialized tools that are good at their respective jobs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.