Search code examples
gitdeploymentwatermarkgit-clone

Git user dependent history or user dependent content


I'm facing a problem of watermarking my work. I want to provide my work to my customers using git repository but with benefits of a doubt. I know how to watermark my work but the question is how to do it per user.

Is there a way to modify content of git clone that it will differ for particular user?

My first thought was to somehow provide different version of single commit for each user but there are couple problems with this solution. First I do not know how to do it and second it is probably not reliable solution as it will be easy to find this commit and change it.

Do you have any idea of how to resolve this issue?


Solution

  • Is there a way to modify content of git clone that it will differ for particular user?

    The short answer is: No, it's not possible.


    The long answer is: To reliable modify the contents of a git clone in a way that cannot be undone by just removing the last commit as you describe, would require you to have a lot of control over the Git server where the repository is being cloned from, and be able to intercept the clone operation and takeover.

    It's probably best if you create a separate Git repository for each client, that contains a single commit flattening the whole history and with the contents already watermarked, and allow the client to clone that repository, instead of the original one with all the history.

    Of course, this repository will have no relation with the original one, so might not satisfy your needs, if you wanted the client to contribute back in the repo - i.e. it wouldn't be easy to merge the client's changes back to the original one.