今天想起以前注册了一些github小号,知道原来的ID但是密码忘记了,找回密码需要原来的邮箱!这时候怎么办?然后我在github搜索到这几个可以只知道用户名然后获取邮箱的脚本!

前提

1.这个脚本建立的前提是,原账号必须有fork过一个仓库,或者创建过一次仓库!!

2.获取的邮箱不一定是百分百正确,具体可以查看原作者网站

步骤

1.安装git debian sudo apt-get install git 方便下载 centos yum -y install git

2.下载 github-email 查找邮箱脚本 git clone git@github.com:paulirish/github-email.git

3.执行 ls 查看下载的文件 cd github-email 进入下载文件夹 你会看到 文件github-email.sh 这个就是我们要使用的脚本了

4.执行 bash github-email.sh xiamuguizhi ximuguizhi 是我的github用户名 你替换你要查找的用户名

执行结果:


Email on GitHub
   Github requires authenticated API requests to retrieve the email. See: https://git.io/vxctz
   To enable, open https://github.com/settings/tokens/new?description=github-email …
   Keep the checkboxes unchecked, hit 'Generate token', copy the token, then run this in your shell:
       export GH_EMAIL_TOKEN=<token>
   You'll also want to add that line to your shell configuration (e.g. .bashrc)

Email on npm
 … skipping …. Please: brew install jq

Emails from recent commits
6@9i3.cn

Emails from owned-repo recent activity
GitHub        noreply@github.com
Paul Irish       paul.irish@gmail.com
Sindre Sorhus       sindresorhus@gmail.com

可以看到6@9i3.cn 就是我邮箱了!! 不过好像 不过精准 还需要一些设置!具体看作者官网吧!我英文白痴!!

作者:paulirish 项目地址:https://github.com/paulirish/github-email