Well proof of work is used to get consensus and prevent double spend in cryptocurrency though there are other mechanisms being tried like proof of stake.
With Git for code you don't really need consensus - I can have my fork and you can have yours.
With Git for code you don't really need consensus - I can have my fork and you can have yours.