The idea has been raised in the past:
Yes, I think you could probably make it work, but it will be complex to allow two modes of editing: via web interface and repository. You need some sort of locking and/or merging mechanism.
* Plugin implementing IWikiChangeListener to prevent concurrent edits and save the content to the repository after editing through the web interface
* Repository hooks to prevent concurrent edits and saving wiki content to the database on Git push
When saving a wiki page through the web interface you'd need to check if the content in the repository has changed and reject saving if the content has changed. You could do this using IWikiManipulator.
Basically, you need to implement the same checks and behavior that prevent concurrent edits to wiki pages. Changes to the repository should be locked during the save operation.
On the repository side, you need to check whether the repository is locked before allowing a push, then lock changes to the modified wiki pages while accepting the push and syncing changes to the wiki. If there are changes to the repository you can block the push and tell the user to pull and merge the changes into their clone of the repository. That's actually easier than on the wiki side since Git is good at merging.