0

I think there might be a bug in laravel homestead.

I followed the docs here to set up a laravel homestead environment to build a Laravel app.

When I commit and push code from within the vagrant/homestead environment, it appears in github like this:

strange commit

I have no idea who user mvdstam is. 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?

johncorser
  • 9,262
  • 17
  • 57
  • 102

2 Answers2

4

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.

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. So basically mvdstam is the default homestead git user.

I spoke to Github about this. 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).

I've posted the issue to Laravel here: https://github.com/laravel/framework/issues/8348

Laurence
  • 58,936
  • 21
  • 171
  • 212
  • Well this is just ridiculous... I knew I must have had a reason for never using Homestead and setting up my own boxes instead. – kalatabe Apr 09 '15 at 08:43
  • 2
    @KaloyanDoichinov that's ridiculous. The only thing you need to do is change the git config to use your name to describe who is committing and pushing. You could create your own box and set your `user.name` to Linus Torvalds and GitHub would show commits by Linus. – ydaetskcoR Apr 09 '15 at 10:21
  • 1
    Really? Would this even pull in Linus's github photo, as it did with `mvdstam`? – johncorser Apr 09 '15 at 14:12
1

mvdstam here!

For those interested, please refer to the corresponding issue on github for more information. 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. 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.

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. Again: "impersonating" as someone else is a feature of Git and not a "bug" or whatever.

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!). Oh well. At least everyone on the internet loves cats.

  • I see why this is a useful feature. It is a little interesting when it bleeds in to open source projects like this! – johncorser Apr 09 '15 at 19:20