Imagine your paper being a GitHub repository with multiple branches, pull requests and a transparent record of changes.

One major challenge is that we currently rely on other metrics for evaluating scientists, so there would need to be a change in the incentive structure to entice researchers to move over.