Wikipedia:Wiki-to-Git

Wiki-to-Git or Wiki2Git is a tool that helps to download MediaWiki page history and push it to a Git repository.

Wiki2Git can be used to export things like a Wikipedia gadget (or a user script) to some Git server (e.g. GitHub or GitLab or Gitea). The history of the Git repository will preserve authors and original messages (original description of changes). Essentially each edit becomes a commit.

Once done you can start using external tools to edit and analyze history of the gadget. You can use Wikiploy to deploy your gadget back to Wikipedia. You can also test easier with things like Mocha/Chai. You can also use build tools like Browserify or Webpack. Wikiploy will also help in deploying dev/test versions.