在GitHub提交响应中,作者和提交者之间有什么区别?
这是对在GitHub提交响应中,作者和提交者之间有什么区别?,git,github,github-api,Git,Github,Github Api,这是对GET/repos/:owner/:repo/committes 作者和提交人之间有什么区别?作者是编写提交中包含的代码的个人。提交者是将代码提交到存储库的个人。当使用拉请求更新存储库时,这对于区分作者和提交者是必要的 当使用拉取请求时,一个单独的分支存储库,进行更改,然后请求将这些更改拉入原始存储库。通常,初始存储库的一名人员将担任守门员,负责审查、批准和拒绝请求 Pro Git以这种方式描述了差异: 作者是最初写这部作品的人,而 提交人是最后一次申请工作的人。所以,如果你 向项目发送修
GET/repos/:owner/:repo/committes
作者
和提交人
之间有什么区别?作者是编写提交中包含的代码的个人。提交者是将代码提交到存储库的个人。当使用拉请求更新存储库时,这对于区分作者和提交者是必要的
当使用拉取请求时,一个单独的分支存储库,进行更改,然后请求将这些更改拉入原始存储库。通常,初始存储库的一名人员将担任守门员,负责审查、批准和拒绝请求
Pro Git以这种方式描述了差异:
作者是最初写这部作品的人,而
提交人是最后一次申请工作的人。所以,如果你
向项目发送修补程序,其中一个核心成员将应用
这个补丁,你们两个都有功劳——你们是作者,你们是作者
作为提交人的核心成员
我的印象是,git支持的这个功能并没有反映在所有GitHub存储库中 例如,查看Ansible/Ansible或PyGithub/PyGithub,两个字段——author和committer——总是相等的 假设用户A分叉存储库R的主节点,提交一个更改C,并向R的网关守护者G请求一个拉请求p以包含C。G合并拉请求p,从而提交C被包含在R的主分支中 现在,查看主分支R的提交,我们看到两个条目: 1提交C,作为A在其R分支上进行。此提交具有作者和提交者用户A 2表示拉请求p的提交。这表示G到R的主分支在C中包含更改。此提交将用户G作为作者和提交者,尽管他没有编写任何代码 因此,如果与git一起正确使用,我猜想这两个字段支持代码源标识。在某些情况下——如上所述——情况可能并非如此。因此,author字段并不总是表示最初编写代码的人 这有什么意义吗?如果没有,请查看上面提到的PyGithub存储库上的一些示例案例。可能重复的
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"commit": {
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"author": {
"name": "Monalisa Octocat",
"email": "support@github.com",
"date": "2011-04-14T16:00:49Z"
},
"committer": {
"name": "Monalisa Octocat",
"email": "support@github.com",
"date": "2011-04-14T16:00:49Z"
},
"message": "Fix all the bugs",
"tree": {
"url": "https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
}
},
"author": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"committer": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"parents": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
}
]
}
]