I have a certain R script which I use in several different repositories. I update it fairly often, and whenever I do I have to remember to update it in every other repository where it's stored, because I need all of them to stay up-to-date. Is there a way to do this automatically, so that whenever one copy of the file is updated all other copies are?
Things I've tried/thought of:
- Hardlinking: the hard link breaks whenever I do a pull or branch switch that alters the file, because git doesn't keep track of hard link metadata.
- There used to be a tool called "git metastore" that possibly helped solve this problem but it seems to be offline, and git-cache-meta doesn't store inode values to restore hard links (although if there's a way to modify it such that this can be achieved that would be pretty great).
- Creating a library: the script contains sensitive information so it cannot be in a publicly hosted library, and privately hosted R libraries can only be updated manually so the problem isn't solved.
- Reading the file from git: same problem as above, it must be in a private repository which cannot be automatically accessed from R without manual input of credentials.