mirror of
https://github.com/Mabbs/mabbs.github.io
synced 2025-10-12 18:00:54 +08:00
Compare commits
5 Commits
ae6a6d3029
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1b5efb8edd | ||
![]() |
971641b3dd | ||
![]() |
c71a48263e | ||
![]() |
21eaed132b | ||
![]() |
5098b24ce6 |
@@ -19,3 +19,4 @@ Lanke's blog,https://blog.blueke.top/,https://blog.blueke.top/rss.xml,请为一
|
||||
时光流·言,https://www.hansjack.com/,https://www.hansjack.com/feed/,个人博客,持续分享网站部署实战经验、精选书评解读和生活观察手记。 这里提供可复用的技术教程、深度阅读指南和真实生活洞察,与技术爱好者一起进步......
|
||||
Pinpe 的云端,https://pinpe.top/,https://pinpe.top/rss.xml,一个属于自己的云朵。
|
||||
Chise Hachiroku,https://chise.hachiroku.com/,https://chise.hachiroku.com/zh/feed/,向明日的辉迹,干杯!
|
||||
映屿,https://www.glowisle.me/,https://www.glowisle.me/atom.xml,关于互联网、书籍、生活琐事以及那些一闪而过的念头
|
||||
|
|
@@ -36,7 +36,6 @@ https://git.dpark.io/mayx/blog
|
||||
https://git.ykonkov.com/mayx/blog
|
||||
http://116.62.245.34:3000/mayx/blog
|
||||
https://git.johann-brauer.de/mayx/blog
|
||||
https://git.barneo-tech.com/mayx/blog
|
||||
https://git.shaunmcpeck.com/mayx/blog
|
||||
http://1.6.141.109:3000/mayx/blog
|
||||
http://52.28.156.42/mayx/blog
|
||||
@@ -85,10 +84,8 @@ https://git.terrainknowledge.com/mayx/blog
|
||||
https://gitea.pickalurv.com/mayx/blog
|
||||
http://183.239.197.12:10803/mayx/blog
|
||||
https://git.zeroplay.io/mayx/blog
|
||||
https://vpgs.pro/mayx/blog
|
||||
https://git.successkaoyan.com/mayx/blog
|
||||
https://git.veydlin.com/mayx/blog
|
||||
https://git.dcircus.com/mayx/blog
|
||||
https://gitea.bitshift.us/mayx/blog
|
||||
http://114.55.134.197:3000/mayx/blog
|
||||
http://139.129.25.251:3000/mayx/blog
|
||||
@@ -112,7 +109,6 @@ https://git.duplanet.ovh/mayx/blog
|
||||
http://Shiningon.top/mayx/blog
|
||||
http://wsygitea.top/mayx/blog
|
||||
https://git.ofdl.tools/mayx/blog
|
||||
http://precious.harpy.faith/mayx/blog
|
||||
https://git.yardtech.ru/mayx/blog
|
||||
http://69.62.77.234:8888/mayx/blog
|
||||
https://gitea.bake.systems/mayx/blog
|
||||
@@ -161,8 +157,6 @@ https://git.Apture.io/mayx/blog
|
||||
https://git.dbfmp.cn/mayx/blog
|
||||
http://103.231.8.120/mayx/blog
|
||||
https://gitea.jasonstolle.com/mayx/blog
|
||||
https://gitea.dokm.xyz/mayx/blog
|
||||
https://nemoserver.iict.bas.bg/mayx/blog
|
||||
https://git.istsoft.ru/mayx/blog
|
||||
http://8.134.61.107:3000/mayx/blog
|
||||
http://47.107.88.161:3000/mayx/blog
|
||||
@@ -182,13 +176,11 @@ https://git.vce.de/mayx/blog
|
||||
https://gitea.carmon.co.kr/mayx/blog
|
||||
http://142.171.47.170:3000/mayx/blog
|
||||
https://git.aion.bi/mayx/blog
|
||||
https://git.skillmad.ru/mayx/blog
|
||||
https://git.werkraum-karlsruhe.org/mayx/blog
|
||||
http://111.231.146.230:8418/mayx/blog
|
||||
https://git.winscloud.net/mayx/blog
|
||||
https://git.pwaapp.cc/mayx/blog
|
||||
http://188.245.99.186:3000/mayx/blog
|
||||
https://sources.krechet.tech/mayx/blog
|
||||
http://119.28.73.80:5000/mayx/blog
|
||||
http://194.60.231.252:3000/mayx/blog
|
||||
https://git.sleepingforest.co.uk/mayx/blog
|
||||
@@ -204,10 +196,7 @@ https://git.reinoud.cloud/mayx/blog
|
||||
https://gitea.chenxu2233.com/mayx/blog
|
||||
http://106.15.78.64:3000/mayx/blog
|
||||
http://hoenking.cn:3000/mayx/blog
|
||||
https://git.harddays.dev/mayx/blog
|
||||
https://git.hantify.ru/mayx/blog
|
||||
https://GIT.Agri-Sys.com/mayx/blog
|
||||
http://8.156.68.150:3008/mayx/blog
|
||||
http://47.113.96.20:3000/mayx/blog
|
||||
https://gitea.anessen.xyz/mayx/blog
|
||||
https://sengit.us/mayx/blog
|
||||
@@ -276,7 +265,6 @@ https://git.libx.ir/mayx/blog
|
||||
https://git.u2.nu/mayx/blog
|
||||
https://bk-house.synology.me:3081/mayx/blog
|
||||
http://123.57.95.66:9000/mayx/blog
|
||||
https://git.the-archive.xyz/mayx/blog
|
||||
http://git.yjmt191314.com/mayx/blog
|
||||
https://git.sparrowcomm.com/mayx/blog
|
||||
https://gitea.chaos-it.pl/mayx/blog
|
||||
@@ -286,7 +274,6 @@ https://git.hubhoo.com/mayx/blog
|
||||
https://git.ultra.pub/mayx/blog
|
||||
https://git.cloud13.de/mayx/blog
|
||||
https://gitea.visoftware.com.co/mayx/blog
|
||||
http://20.249.208.89:3000/mayx/blog
|
||||
http://121.199.172.238:3000/mayx/blog
|
||||
http://27.124.12.222:3000/mayx/blog
|
||||
https://wzpmc.cn:3000/mayx/blog
|
||||
@@ -305,7 +292,6 @@ https://git.saintdoggie.org/mayx/blog
|
||||
http://blackobelisk.xyz:3000/mayx/blog
|
||||
https://git.dushes.keenetic.pro/mayx/blog
|
||||
https://git.go-chat.ru/mayx/blog
|
||||
https://gitt.vireoapp.com/mayx/blog
|
||||
http://47.129.22.53:22345/mayx/blog
|
||||
https://git.tech.troyrc.com/mayx/blog
|
||||
http://git.zkyspace.top/mayx/blog
|
||||
@@ -320,7 +306,6 @@ http://8.137.38.60:8201/mayx/blog
|
||||
https://git.emoscape.org/mayx/blog
|
||||
http://112.74.106.216:3000/mayx/blog
|
||||
http://77.223.118.106:8081/mayx/blog
|
||||
http://frp-old.com:41879/mayx/blog
|
||||
https://git.the-kn.com/mayx/blog
|
||||
https://git.campfiregg.ru/mayx/blog
|
||||
https://gitea.net50.ne.jp/mayx/blog
|
||||
@@ -329,7 +314,6 @@ http://sinzero.xyz:3000/mayx/blog
|
||||
http://69.10.53.202:3000/mayx/blog
|
||||
https://gitea.b54.co/mayx/blog
|
||||
https://git.matevi.sh/mayx/blog
|
||||
http://gitea-ui.shiba-server.fr:19000/mayx/blog
|
||||
http://www.pcaidiy.cn:3000/mayx/blog
|
||||
https://code.tiantongsl.com/mayx/blog
|
||||
http://213.35.118.215:60001/mayx/blog
|
||||
@@ -339,7 +323,6 @@ https://git.pasarex.com/mayx/blog
|
||||
http://1.95.221.174:3000/mayx/blog
|
||||
https://git.wangxinlei.cn/mayx/blog
|
||||
http://101.200.74.121:3000/mayx/blog
|
||||
https://potokobox-releases.prodduction.ru/mayx/blog
|
||||
http://123.56.193.182:3000/mayx/blog
|
||||
https://git.akarpov.ru/mayx/blog
|
||||
http://60.204.131.99:3000/mayx/blog
|
||||
@@ -351,7 +334,6 @@ http://167.172.7.198:8081/mayx/blog
|
||||
https://gitea.meetgu.ru/mayx/blog
|
||||
http://8.134.253.108:3000/mayx/blog
|
||||
https://git.patrich.se/mayx/blog
|
||||
http://47.251.18.130:3000/mayx/blog
|
||||
http://116.236.50.103:8789/mayx/blog
|
||||
https://gitnto.innovationcampus.ru/mayx/blog
|
||||
https://git.paulll.cc/mayx/blog
|
||||
@@ -373,7 +355,6 @@ https://git.4lcap.com/mayx/blog
|
||||
https://gitea.bastiqui.com/mayx/blog
|
||||
https://git.stit.tech/mayx/blog
|
||||
https://git.wun.im/mayx/blog
|
||||
https://git.lichx.top/mayx/blog
|
||||
https://www.9miao.fun:6839/mayx/blog
|
||||
https://git.ssktv.vip/mayx/blog
|
||||
https://git.autotion.net/mayx/blog
|
||||
@@ -451,7 +432,6 @@ https://lius.familyds.org:3000/mayx/blog
|
||||
https://git.morozoff.pro/mayx/blog
|
||||
https://gitea.questline.coop/mayx/blog
|
||||
https://gitea.mpc-web.jp/mayx/blog
|
||||
https://git.roshanca.com/mayx/blog
|
||||
https://git.poggerer.xyz/mayx/blog
|
||||
https://git.wisptales.org/mayx/blog
|
||||
https://git.peaksscrm.com/mayx/blog
|
||||
@@ -524,7 +504,6 @@ http://47.109.95.73:3000/mayx/blog
|
||||
http://47.104.196.63:8418/mayx/blog
|
||||
https://git.mkubiak.com/mayx/blog
|
||||
http://38.22.90.74:3000/mayx/blog
|
||||
https://git.unknwn.ru/mayx/blog
|
||||
https://git.asdf.cafe/mayx/blog
|
||||
http://8.133.240.249:3456/mayx/blog
|
||||
https://git.mista.ru/mayx/blog
|
||||
@@ -588,3 +567,33 @@ https://git.ricecakecat.com/mayx/blog
|
||||
https://git.mahaines.com/mayx/blog
|
||||
http://gitee.mrsang.cfd/mayx/blog
|
||||
https://gittea.biveki.ru/mayx/blog
|
||||
https://git.7milch.com/mayx/blog
|
||||
https://gitea.marvinronk.com/mayx/blog
|
||||
https://gitea.zmanplex.com/mayx/blog
|
||||
https://git.hexdive.com/mayx/blog
|
||||
http://139.224.250.209:3000/mayx/blog
|
||||
https://vcc808.site/mayx/blog
|
||||
https://battitech.net/mayx/blog
|
||||
https://git.sitenevis.com/mayx/blog
|
||||
https://git.nightime.org/mayx/blog
|
||||
https://dreamplacesai.de/mayx/blog
|
||||
http://repo.bpo.technology/mayx/blog
|
||||
https://git.soy.dog/mayx/blog
|
||||
https://bachner.synology.me:10002/mayx/blog
|
||||
https://git.cool2645.com/mayx/blog
|
||||
https://gitea.codedbycaleb.com/mayx/blog
|
||||
https://gitea.jludwig.net/mayx/blog
|
||||
https://git.z1.mk/mayx/blog
|
||||
http://185.87.111.46:3000/mayx/blog
|
||||
http://suncheng.asia:14200/mayx/blog
|
||||
https://git.sorogon.eu/mayx/blog
|
||||
http://1.94.13.224:9080/mayx/blog
|
||||
https://git.manabo.org/mayx/blog
|
||||
https://auric-org.org/mayx/blog
|
||||
https://git.git-happens.de/mayx/blog
|
||||
https://gitea.seanomad.ru/mayx/blog
|
||||
http://47.104.241.192:19999/mayx/blog
|
||||
http://47.105.61.58:3000/mayx/blog
|
||||
https://git.memosnag.com/mayx/blog
|
||||
http://tdss.website:801/mayx/blog
|
||||
https://gitea.wenpang.asia/mayx/blog
|
||||
|
|
29
_posts/2025-10-12-recover.md
Normal file
29
_posts/2025-10-12-recover.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
layout: post
|
||||
title: 一次找回GitHub上被删除仓库的经历
|
||||
tags: [GitHub, Git, 代码恢复, 软件存档]
|
||||
---
|
||||
|
||||
在GitHub中寻找踪迹也许是非常简单的事情……<!--more-->
|
||||
|
||||
# 起因
|
||||
前段时间,有人和我聊天的时候提到了[Brainfuck](https://esolangs.org/wiki/Brainfuck)语言,让我回想起了高中时写的[演讲稿](/%E6%BC%94%E8%AE%B2%E7%A8%BF/2018/06/20/Coding.html)。那时候我在演讲时也介绍了Brainfuck语言。对于Brainfuck的解释器,[各种语言都可以实现](https://rosettacode.org/wiki/RCBF),不过我当时为了方便理解用了一个在GitHub Pages上的网站,用可视化的方式演示了它的运行过程,效果很不错。现在既然聊到了,自然就想分享一下这个[演示的网站](https://fatiherikli.github.io/brainfuck-visualizer/),但我正想打开时,发现网站已经404了😰。
|
||||
在GitHub Pages上的网站都有对应的仓库,现在不仅原仓库消失了,连作者的[首页](https://github.com/fatiherikli)都打不开,看样子是完全退出GitHub了……那么我想找到这个网站的想法就无法实现了吗?不过GitHub有些有意思的特性也许能帮助我找回这个网站。
|
||||
|
||||
# GitHub的特性
|
||||
在GitHub中,一个普通的仓库可能没有什么特别的,也许就是服务器上的一个文件夹。但是当仓库被其他人Fork的时候就不一样了,在执行Fork时,显然GitHub不会完整复制整个仓库。否则,同一个仓库在服务器上会占用双倍空间,这显然不合理。另外,想想Git的结构:它由提交对象和分支指针构成,每次提交都有唯一的Hash值且不会冲突。因此可以推测,GitHub在实现Fork时,所有被Fork的仓库可能共享同一个对象库,而每个用户仓库只保存指针,这样所有仓库只会占用增量空间,而不会存储重复内容。
|
||||
但这样也会带来一个问题,首先因为很多人可能要共用一部分对象,所以也很难确认对象的所有权,而且也因为这个原因所有的对象要能被所有人访问。因此在整个Fork网络中,只要有一个仓库存在,GitHub就必须保留所有的对象,而且每个仓库都能访问这个网络中所有的对象。为了验证这一点,我们可以用最知名的[Linux内核仓库](https://github.com/torvalds/linux)做个示例。
|
||||
首先对Linux仓库进行Fork,然后我们可以随便做一些改动,比如在README中写“Linux已经被我占领了😆”之类的内容,提交到自己的仓库,并且记下提交的Hash值,接下来就可以把自己的仓库删掉了。如果上面的猜想是正确的,那么在这个Fork网络中的任何一个仓库查看我刚刚的提交应该都可以,于是我直接在主仓库拼上了[提交的Hash值](https://github.com/torvalds/linux/tree/78e1d0446b94012da8639aa2b157d4f2dee481ce)(顺便一说只要值唯一,和其他的提交不冲突,[短的Hash值](https://github.com/torvalds/linux/tree/78e1d044)也可以),果不其然能找到刚刚修改的内容,这样一来,只要GitHub和任意一个Linux仓库的Fork还存在,这个提交就永远存在了😝。
|
||||
|
||||
# 找回仓库
|
||||
那么接下来找回之前网站的方案就很简单了,我只要找到网站仓库的任意一个Fork,然后只要知道最新的提交Hash,我就可以还原最新的仓库了。Fork倒是好找,随便搜一下[就能找到一个](https://github.com/ashupk/brainfuck-visualizer)。这个Fork的最新提交是2016年,但要想找到我当年演讲的版本至少到2018年之后。不过这个Hash值也不太好找,虽然理论上爆破短Hash值也可以,但是感觉太麻烦了,没有那个必要,所以我干脆直接去互联网档案馆看看能找到的[最新的仓库页面](https://web.archive.org/web/20201229125043/https://github.com/fatiherikli/brainfuck-visualizer/)吧,这样我就能找到它的Hash值了,然后我再把Fork仓库的地址和Hash拼到一起,就看得到最新代码了。
|
||||
当然,仅仅看到代码还不够。我想Fork这个项目并在自己的GitHub Pages上部署一份。有没有什么好办法可以将我仓库的HEAD指针指向最新的提交呢?其实很简单,首先我要Fork这个Fork仓库,然后Clone我的仓库到本地。不过,此时Clone下来的仓库并不包含GitHub上完整的对象库,因此直接checkout或reset是不行的。这时Hash值就派上用场了,通过fetch拉取对应提交后,就可以进行上述操作。具体命令如下:
|
||||
```bash
|
||||
git fetch origin <commit-hash>
|
||||
git reset --hard <commit-hash>
|
||||
git push origin master
|
||||
```
|
||||
最终我就获得了包含[最新代码](https://github.com/Mabbs/brainfuck-visualizer)的[Brainfuck可视化演示](https://mabbs.github.io/brainfuck-visualizer/)了🎉。
|
||||
|
||||
# 结局
|
||||
后来我才知道,原来有一个专门的组织[Software Heritage](https://archive.softwareheritage.org)会保存所有代码,根本没必要搞这些花里胡哨的操作😂,像这个仓库也是能很轻易在[上面](https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://github.com/fatiherikli/brainfuck-visualizer)找到,这下以后知道了,再遇到类似情况就可以直接去Software Heritage查找,而不必在互联网档案馆上找线索瞎折腾了🤣。
|
@@ -67,6 +67,7 @@ image: https://screenshot.mayx.eu.org/
|
||||
<p>
|
||||
<a href="/service.html">Mayx的公开服务</a><br />
|
||||
凯露&危险生存( <a href="{% unless site.github %}https://mabbs.github.io{% endunless %}/karyl-yabaival/?cn">CHS</a> | <a href="{% unless site.github %}https://mabbs.github.io{% endunless %}/karyl-yabaival/">JA</a> | <a href="{% unless site.github %}https://mabbs.github.io{% endunless %}/karyl-yabaival/?kr">KO</a> )<br />
|
||||
<a href="{% unless site.github %}https://mabbs.github.io{% endunless %}/brainfuck-visualizer/">Brainfuck可视化演示</a><br />
|
||||
<a href="/message.html">留言板</a><br />
|
||||
<a href="/links.html">Links</a><br />
|
||||
<a href="/proxylist.html">代理列表</a><br />
|
||||
|
Reference in New Issue
Block a user