GitHub存储库如何通过明显的提交获得零贡献者?

时间:2017-05-31 10:50:18

标签: github

我注意到GitHub repository没有明显提交的贡献者。这怎么可能?

http://i.imgur.com/rFyNbgb.png

1 个答案:

答案 0 :(得分:2)

提交者电子邮件与任何 GitHub帐户无关。通过选择随机提交,添加添加.patch后缀,您可以看到:

  

https://github.com/atomiks/reddit-user-analyser/commit/508b9f745dcfd9117367fa88e982bb739ecac616.patch

From 508b9f745dcfd9117367fa88e982bb739ecac616 Mon Sep 17 00:00:00 2001
From: atomiks <na@gmail.com>
Date: Wed, 22 Feb 2017 08:47:53 +1100
Subject: [PATCH] separate comments and submissions timeframes

...

na@gmail.com可能与任何GitHub帐户无关。

您可以按照以下步骤创建此类存储库:

# Create the Git repo locally
$ mkdir foo
$ cd foo/
$ git init
Initialized empty Git repository in /.../foo/.git/

# Create some files
$ echo 'foo' > index.js
$ ls
index.js

# Create the commit, but pass an invalid email address
# or one you are sure that is not associated with *any*
# GitHub account
$ git add . -A
$ git commit -m 'Initial' . --author 'foo <fooooooo_or_invalid_email_address_which_is_not_on_github@bar.com>'
[master a34597b] Initial
 Author: foo <fooooooo_or_invalid_email_address_which_is_not_on_github@bar.com>
 Date: Wed May 31 13:51:19 2017 +0300
 1 file changed, 1 insertion(+)
 create mode 100644 index.js

# Add the GitHub url
$ git remote add origin git@github.com:IonicaBizau/tmp42.git

# Push the repo
$ git push --all
Counting objects: 3, done.
Writing objects: 100% (3/3), 271 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To github.com:IonicaBizau/tmp42.git
 * [new branch]      master -> master

然后在Github repo页面上你会看到:

点击提交网址并添加.patch后缀(以获取原始信息):

From a34597b39da17eb77ab29f686a78b276a3c18376 Mon Sep 17 00:00:00 2001
From: foo <fooooooo_or_invalid_email_address_which_is_not_on_github@bar.com>
Date: Wed, 31 May 2017 13:51:19 +0300
Subject: [PATCH] Initial

---
 index.js | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 index.js

diff --git a/index.js b/index.js
new file mode 100644
index 0000000..257cc56
--- /dev/null
+++ b/index.js
@@ -0,0 +1 @@
+foo