简体   繁体   English

Laravel Homestead可能的错误-为什么我可以以用户mvdstam的身份将代码提交到github?

[英]Possible Laravel Homestead bug- why is it that I can commit code to github as user mvdstam?

I think there might be a bug in laravel homestead. 我认为laravel家园中可能有一个错误。

I followed the docs here to set up a laravel homestead environment to build a Laravel app. 我按照此处的文档设置了laravel宅基地环境,以构建Laravel应用。

When I commit and push code from within the vagrant/homestead environment, it appears in github like this: 当我在vagrant / homestead环境中提交并推送代码时,它在github中的显示如下:

奇怪的提交

I have no idea who user mvdstam is. 我不知道谁是用户mvdstam。 And yet I seem to be able to commit code as though I am him. 但是我似乎能够像我一样提交代码。

Anyone know what might be causing this? 有人知道这可能是什么造成的吗? I uninstalled everything related to laravel homestead as I've abandoned this project, but my guess would be that the default gitconfig contains his credentials? 我放弃了这个项目后,就卸载了与laravel homestead相关的所有内容,但是我猜是默认的gitconfig包含他的凭据吗?

Lol. 大声笑。 I had this exact issue yesterday. 我昨天有这个确切的问题。

The reason is that you have not set the global username and email to commit as. 原因是您尚未设置全局用户名和电子邮件提交为。 So when you push your changes to Github - it doesnt know who you are. 因此,当您将更改推送到Github时-它不知道您是谁。

To fix this - set your globals first: 要解决此问题,请先设置全局变量:

git config --global user.name "Your name"
git config --global user.email "Your email address"

The reason user mvdstam is there is it seems to be in homestead as the last user, before the change was committed to homestead. 用户mvdstam出现的原因似乎是,在将更改提交给宅基地之前,它是最后一个用户在宅基地中的。 So basically mvdstam is the default homestead git user. 因此,基本上mvdstam是默认的宅基git用户。

I spoke to Github about this. 我曾与Github谈过此事。 What is important to note is that user mvdstam does not have access to your private project - it is just a symbolic link in your project that he did the commit (even though he didnt). 需要注意的重要一点是,用户mvdstam 无法访问您的私有项目-它只是您所做的提交(即使他没有提交)在您项目中的符号链接。

I've posted the issue to Laravel here: https://github.com/laravel/framework/issues/8348 我已经将问题发布到Laravel了: https : //github.com/laravel/framework/issues/8348

mvdstam here! mvdstam在这里!

For those interested, please refer to the corresponding issue on github for more information. 对于那些感兴趣的人,请参考github上相应问题以获取更多信息。 The issue has been "resolved", my account isn't showing up anymore for you. 该问题已“解决”,我的帐户不再为您显示。 Long story short, the default mailaddress that git uses on unconfigured machines was linked to my Github account, meaning that everyone doing commits was doing it as an alias for my account. 长话短说,git在未配置的机器上使用的默认邮件地址已链接到我的Github帐户,这意味着每个提交的人都将其作为我的帐户的别名。 However, if you did have this issue, it means that your Homestead box isn't configured correctly (at least regarding your Git setup), since Git is falling back to assumed defaults. 但是,如果确实有此问题,则意味着您的Homestead盒未正确配置(至少与Git设置有关),因为Git会恢复为默认值。

What's really important to note, though, is that you can never, ever, ever push your commits to repos under someone else's (linked/aliased) account. 不过,真正要注意的是,您永远都不可能提交提交到他人(关联/别名)帐户下的回购中。 Commits, yes. 承诺,是的。 Pushes, no. 推,不。 You'd still need valid credentials for that. 您仍然需要有效的凭据。 However, doing commits under someone else's name (which is actually a documented feature of Git! ) will mean that those commits will show up as such in the repo commit history. 但是,以其他人的名义进行提交(实际上是Git记录功能! )将意味着这些提交将在回购提交历史记录中显示出来。 Again: "impersonating" as someone else is a feature of Git and not a "bug" or whatever. 再次:“冒充”是Git的功能,而不是“ bug”或其他任何东西。

The photograph of me and my lovely kitten showing up on everyone's commit history is, to put it mildly, an unforeseen consequence of the above (yay for integrated Gravatar!). 温和地说,我和我可爱的小猫出现在每个人的提交历史上的照片,是上述情况的不可预见的结果(是整合Gravatar的结果!)。 Oh well. 那好吧。 At least everyone on the internet loves cats. 至少互联网上的每个人都喜欢猫。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM