Get GitHub username from commit history

守給你的承諾、 提交于 2019-12-10 19:05:57

问题


I cloned a repo to my machine, and did

git log

but in the logs, it shows the persons full name and email, rather than their github username.

Is there a way to associate the commits to a user without relying on GitHub's website?


回答1:


If you want to use git log there doesn't seem to be a way to show the GitHub username, because git doesn't know anything about the concept of users on GitHub. However, you could search for the email address shown in git log on GitHub by searching for "email@address.com in:email" and clicking "Users" in the left sidebar.

Otherwise, you could use the GitHub API directly: https://developer.github.com/v3/repos/commits/

Last but not least, you could use the Commit-view on GitHub: https://github.com/github/gitignore/commits/master




回答2:


Nope, since the data is now on your machine and has nothing to to with github.

Github use user/password or SSH to authenticate users.
The github users that you see on the site is something they render on the server side.

So the answer is no unless you run script to fetch the date.


GITHUB API

You might be able to use this but you will need the vice versa info i assume



来源:https://stackoverflow.com/questions/34600040/get-github-username-from-commit-history

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!