Force a change to a linked file

23 Views Asked by At

Excuse the fairly simple question, but I'm a Git newbie. How do I force a developer to make a change to a file that is associated to the 'parent' file that he/she is changing/committing? We are a Windows shop using GitLab, SourceTree and TortoiseGit.

1

There are 1 best solutions below

2
Vampire On

You add a pre-receive hook to the GitLab repository where he pushes to. In the script you can validate all newly pushed commits to make sure the commit contains both files or none of them. If the script fails, the push is aborted and the dev has to fix his commit first.