2017-05-31 130 views

回答

2

修訂者電子郵件沒有與任何GitHub的帳戶相關聯。通過拾取隨機提交,添加添加後綴.patch你可以看到這一點:

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

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

... 

[email protected]很可能不與任何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 <[email protected]>' 
[master a34597b] Initial 
Author: foo <[email protected]> 
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 [email protected]: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庫頁面上,你會看到:

點擊提交網址並加入.patch後綴(獲取原始信息):

From a34597b39da17eb77ab29f686a78b276a3c18376 Mon Sep 17 00:00:00 2001 
From: foo <[email protected]> 
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 
+1

@mythereal我剛剛添加了一個例子。您可以使用'--author'選項或編輯'.gitconfig'文件來更改提交的作者。 –

+0

哇。非常感謝。這很有啓發。 – mythereal

+0

@mythereal不客氣! :) –