是否可以使用 git 找出文件是在哪台计算机上制作的?

Is it possible to use git to find out what computer a file was made on?

是否可以使用 git 找出文件是在哪台计算机上创建的?如果您有代码存储库,是否可以检查这些文件并查看它们是在哪台计算机上创建的以及由什么用户名创建的?例如,它们是在 mac 还是 linux 上创建的?

不,我不认为这是可能的。 Git 存储库只是一组提交。来自一篇很棒的 DZone 文章 (Git Behind the Curtain: What Happens When You Commit, Branch, and Merge):

Each commit contains three pieces of information: metadata about the commit (who made it, when it happened, and the message), a list of parent commits (which is empty for the first commit but has at least one entry for every other commit), and a reference to the “tree” object holding the root of the project directory.

即便如此,"who" 部分仍来自您的 Git 配置 -- user.name & user.email.