All github does is provide convenience. If you want to use github in a peer-to-peer fashion all the tools are already there.
Mercurial had a single command for this, "hg serve", that would just pop up a webserver for sharing. It was extremely useful for me during university, and I've often considered it a key failing that git does not provide a similar command out of the box. As a result, the distributed nature of git is hidden from a lot of people.
For the record, the command to make git do what mercurial does with hg serve is "git daemon --reuseaddr --base-path=. --export-all --verbose --enable=receive-pack".
Obviously this is insecure and anyone who can establish a connection can push and pull from your repo, but if you're just jamming with some friends you don't need github.
You don't even have to "host a server". Simply allowing ssh access to your machine is enough.
The vast majority of Linux developers don't have their own publicly-accessible repository that you can pull from - they push patches to the mailing list.
Various archives can host copies of the mailing lists (you can ask https://www.mail-archive.com to do so for you), and the git repository can obviously be mirrored anywhere anyone who can clone it likes. Congratulations, you now have a globally mirrored, decentralised development process where the canonical repo and any patches submitted never disappear.
But instead having many small hand-maintained servers, the admin of each is responsible for what's hosted on it, and of which there is no registry, doesn't sound much better. Very likely there would be a handful of effective central nodes in that network, but if you take down a couple of them, you end up with a situation where already-involved devs might still be able to navigate the landscape, but for a newcomer it might be really hard to find one of those nodes, or be sure it's one with the "right" revisions.
This is because Pagure stores not just code but also all the project metadata (issues, PRs, Wiki pages, etc.).¨
In comparison most other git forges, including the big ones (GitHub/GitLab) store all project metadata in a central database, so if you want to move or even backup/restore a project you need to do a complicated export/import process.
In comparison on Pagure you can just clone the repo and get all the project data with it. Then just put it on another Pagure instance - done.
Should not be hard to adapt this system to be backed by a distributed system from below.
Proper p2p would be like joining a DHT swarm with a hash and downloading pieces from other peers.
Also, please be gentle with the instance linked above. If you're running patchwork and have git-ssb installed, it should be available on http://localhost:7718 instead, that's really the way to go.
Anyway, I'm not sure how any kind of p2p system like that's gonna work for the average person and become mainstream when most consumer devices run on battery and drop off the network constantly to save power. Yes there are gateways but that kinda defeats the purpose. Seems better suited as a datacenter tool than something to ship out to normal end users.
At any rate it's not designed for anonymity, so its utility as a piracy tool is limited unless you're on a private IPFS network, which requires server resources.
The idea is quite nice but I wish it wasn't based in NodeJS. I also don't like that it integrates BitCoin - personally I think it just motivates people to try and take over the project.
EDIT: There's also GitChain [2] which again seems abandoned (since 6 years).
One solution is hiding names from everything like say Pirate Bay/Silk Road but I would not trust anything like that to run in my machine. I wouldn't even download TPB app if it is going to be released. It would also make discovery very hard.
I mean realistically speaking, only solution to DMCA is through lobbying but that is almost impossible for individuals to do. This is something that needs to be done through large tech companies but it seems they think laws like DMCA increases the regulatory burden on their competitors and hence don’t care.
But that's where bittorrent comes in, they've solved that issue already.
A p2p bittorrent / magnet file index would work though, through Git (for an offline copy) or otherwise. I'm sure something like that already exists though, I've not been in the piracy world for a while now.