Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Laravel, Vagrant & Homestead: Does it matter where I initialise git?

Referring to the first 60 seconds of this video:

http://teamtreehouse.com/library/laravel-basics/getting-started-with-laravel/laravel-folder-structure

Hampton Paulk explains that when using Homestead and vagrant, the laravel application folder & files are maintained in two different places - the virtual machine & locally - and synchronized with one another.

Is there a 'best place' to initialize a git repository (inside or outside the virtual machine)? I guess the actual .git files will be synchronized along with everything else... so maybe this doesn't even matter!

Are there differences when using git with this setup? e.g. will checking out branches from inside the VM (virtual machine) do the same outside the VM? Can I push to github from both?

Thanks!

geoffrey
geoffrey
28,736 Points

That's actually a great question and something I was wondering, I guess It doesn't matter much, the best would be to test it, but haven't got the time yet :) Or Should I say haven't taken the time yet ;-) !

Waiting for an answer in the meantime ;)

I've had a little play and so far I can see no difference interacting with git inside/outside of virtualbox. Even if you have two tabs open simultaneously (one inside vagrant, one not), checking out a branch will immediately update the other location.

To answer my own question, it doesn't seem to matter at all!

1 Answer

geoffrey
geoffrey
28,736 Points

Thank you for the feedback Tom, that's great to hear, I'll probably play with it soon.

I've found that pushing from outside of homestead is a little nicer. At least for me - it keeps prompting for my ssh pass-phrase for pushes inside Vagrant.