R256 After rewriting a shared branch’s history, tell those who work on it
Once you have rewritten the pushed history of a branch that others work on, tell each of them, before your task ends, to clone again or to reset to the new history before they go on.
Reason
A rewrite of shared history reaches everyone who has the old history (Art. V §1(3)): their next pull or push mixes the two histories, and can bring back what the rewrite removed, such as a leaked secret or a large file.
Verification
History is rewritten when a push replaces commits that the branch already had, as a force push does. Those who work on the branch are the people and agents known to have it checked out or to have pushed to it, and, on a branch every collaborator of the repository uses such as the main branch, all of the repository’s collaborators. The message goes where they read work messages, names the branch and the new head, and says what to do with work based on the old history.
Violated when the task in which such a rewrite was made ends while someone who works on the branch has not been told.