The reason that I want this is that I am currently developing a website on my linux box and uploading it to the server when I have completed updates.
In each directory I have some files that are the same for each directory of the project. I would like to edit these files as if they were all one file so hardlinking them seems the way to go. This results in a single file to be edited in my development environment and separate copies of this single file in each directory of my production environment because copying of several files linked to the same inode from one system to another results in each destination file having its own inode.
Once I set this up I asked myself the question of how to then customise these constant files in these directories when I need to. As I pointed out in my original post I can always copy to a temp file, remove the hardlinked file and then move the temp file to the original filename or I could copy with a remove destination option from another file that shares the inode as was demonstrated earlier. The first option is a bit inelegant and the second has the requirement that you need to find another file that shares the inode of the file you want to convert.
A more complete description of what I am looking for
Assigns a new inode and copies to it the data from the original inode like cp would do.
Delink file1 from its current inode and decrement the inode's refcount by 1 like rm would do.
Link file1 to the new inode and increment the inode's refcount by 1 like ln would do.
This would eliminate the need for a temp filename and eliminate the need to find another file with the same inode.
I think if such a facility does not already exist that it would be a good feature to add to bash and to the stand alone versions of either ln, mv or cp.