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

Development Tools

Nick Basile
Nick Basile
17,942 Points

Integrating Vagrant and Github

Hi everyone! Sorry if this is a super simple question, but I was hoping someone could provide me with a good explanation for this. How can I use Github with Vagrant?

Right now I am working on a Laravel project using Homestead in a Vagrant machine, and I would love to have some version control for my work. Do I just need to set up a repository in my Github account or is it a more involved process?

Thanks for the help!

4 Answers

Brian Fallon
Brian Fallon
4,733 Points

Your vagrant box is essentially just a VM so you should be fine just creating a Github repo for your project, no further config from there, assuming we are talking about the project inside the Vagrant box.

If you are looking to have version control over your Vagrantfile then you would also have to add that to a git repo if you're looking to be able to change config stuff around when spinning up new boxes.

Nick Basile
Nick Basile
17,942 Points

Thanks Brian, that was just the answer I was looking for!

Tell us what OS are you Using Coz im Using Windows 7 I can help you out

Nick Basile
Nick Basile
17,942 Points

I'm on OS X Yosemite.

Get bitbucket account or Github

The sample below is for bitbucket, it should work also with github

For example, if you have an existing project to push up: cd /path/to/my/repo git remote add origin ssh://git@bitbucket.org/username/bbreponame.git git push -u origin --all

Or if you are starting from scratch:

mkdir /path/to/your/project cd /path/to/your/project git init git remote add origin ssh://git@bitbucket.org/username/bbreponame.git