VVV and Version Control Workflow

Created on 20 Nov 2014  Â·  12Comments  Â·  Source: Varying-Vagrant-Vagrants/VVV

Ok, I configured VVV, without problems. Now, the question: How is does the versioning workflow works? VVV creates directory (www) where I can place various projects. I think I could version every project individually, but the Vagrant purpose it's to include boxes in versioning too, right? So, I have to do the versioning to all the VVV? Versioning all the VVV, in a environment where multiple projects will be developed, will became confuse, will it not? Or maybe, I could version VVV and each project individually on some way? Anyway, I searched but haven't found nothing much clear on this matter.

question

Most helpful comment

You don't, VVV isn't a starter template you modify like underscores and the
www folder isn't a generic public_html you dump stuff into

Creating a site then doing a git clone into it after a provision is
perfectly possible and happens everyday.

So:

  • grab a copy of VVV
  • provision it
  • go to one of the installs it created
  • add your stuff

If your stuff just happens to be a git repo of a wp-content folder then
great, open it up in Atom and use all your usual tools. Just as you would
with MAMP or any other local Dev environment.

As for why the www folder is ignored, well you wouldn't want to add your
files to VVV core would you? Then you wouldn't be able to update, either
that or all VVV users get your files. You can have different git repos in
that folder they don't have to be all under the same repo.

Additionally, VVV isn't something you set up over and over again for each
project. You only need one copy of VVV, and the www folder can have
multiple sites representing multiple projects

On Fri, 7 Jun 2019 at 23:26, Allyson Souza notifications@github.com wrote:

Man..., I'm taking a look at VVV today, 5 years later... And I still don't
understands how I'm supposed to version control my projects into it. If
/www/* is in .gitignore, how I'm supposed to version control my projects?
I need to do it inside the virtual machine - so I can't benefit from git
tools in VSCode/Atom, for example?

(PS: I'm feeling extremely dumb to going back here and have the same doubt
as 5 years ago)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Varying-Vagrant-Vagrants/VVV/issues/508?email_source=notifications&email_token=AAAOLZYGE4RPF2NAJZ2FDH3PZLOCLA5CNFSM4AXYOTB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXHESMY#issuecomment-500058419,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAOLZ5KUCHMECVKA447PMTPZLOCLANCNFSM4AXYOTBQ
.

All 12 comments

Not entirely sure I understand the question.

If you're asking How do I version control my individual projects? the answer is: It depends.

If you use git to deploy WordPress sites, you probably want to run git init on your wp-content folder.

If you use git to version control your theme, and then another tool to deploy the rest of WordPress, you probably just want to run git init on your WordPress theme, and then vagrant ssh into Vagrant and run your deployment tool from inside the VM. You can take a look at my WordPress workflow here.

Let me know if i can be of further help!

Hi @joeguilmette, thank you for your reply.

I'll see your workflow. My question is: I need to version control the Vagrant with the project, because changes in box configurations can be made by one user, no?

Well the gitignore file specifically excludes the project folders. Sure,
you could change that and then version control the whole thing on your own
fork.

But why?

Why not:

  • Version control VVV
  • Version control your individual projects

I can think of 20 reasons why you'd want to do it separate and no
compelling reasons why you'd to do it together.
On Fri, Nov 28, 2014 at 8:18 PM Allyson Alves de Souza <
[email protected]> wrote:

Hi @joeguilmette https://github.com/joeguilmette, thank you for your
reply.

I'll see your workflow. My question is: I need to version control the
Vagrant with the project, because changes in box configurations can be made
by one user, no?

—
Reply to this email directly or view it on GitHub
https://github.com/Varying-Vagrant-Vagrants/VVV/issues/508#issuecomment-64892972
.

Can this be reopened so I can get some clarification on this same issue?

From https://www.vagrantup.com/docs/vagrantfile/

Vagrant is meant to run with one Vagrantfile per project, and the Vagrantfile is supposed to be committed to version control. This allows other developers involved in the project to check out the code, run vagrant up, and be on their way. Vagrantfiles are portable across every platform Vagrant supports.

That's the point of using Vagrant. If you have multiple developers working on a project they should be able to clone and be on their way. So the original question is, how can we accomplish this? Let's say we can point to a repo in our config which contains the content of the wp-content directory (I'm looking at you vv https://github.com/bradp/vv) how can we get to a point where we can create a repo which when checked out we only have to "run vagrant up".

In this use-case the wp-content repo is still separate from the vvv configuration but a new developer can still get started on any machine quickly with a consistent Vagrant environment (which Vagrant was ment for).

You know, together but apart, so poetic...

Vagrant is meant to run with one Vagrantfile per project, and the Vagrantfile is supposed to be committed to version control.

It already is: https://github.com/Varying-Vagrant-Vagrants/VVV/blob/develop/Vagrantfile

That's the point of using Vagrant. If you have multiple developers working on a project they should be able to clone and be on their way.

This is already the case, they add a site to vvv-custom.yml that references a git repo, and VVV clones it into the appropriate place and runs the provisioners.

Let's say we can point to a repo in our config which contains the content of the wp-content directory (I'm looking at you vv https://github.com/bradp/vv) how can we get to a point where we can create a repo which when checked out we only have to "run vagrant up".

That flow is backwards to what we have right now. The end result is that multiple VVV environments end up running, and only 1 can reliably have port 80 access. The end result is either a mess, or only being able to work on 1 site at a time

Keep in mind that there's nothing stopping you forking the custom-site-template and modifying the provisioner to check a wpcontent flag in the config, and git clone a repo into that folder. It's just a standard *nix shell script

In this use-case the wp-content repo is still separate from the vvv configuration but a new developer can still get started on any machine quickly with a consistent Vagrant environment (which Vagrant was ment for).

It sounds like your IDE or editor is incapable of showing folders on their own and forces you to use a full folder tree as the only option, or it doesn't support projects.

Either way, it sounds like you're trying to solve a problem that hasn't been defined here, aka "I want to have a folder full of projects, where each project is a wp-content folder, and I don't want to have to deal with all the other files".

There are a few problems with this, e.g. where does the WP instance go, where does wp-config.php go, etc. This is one of the reasons VVV sites have a public html folder instead of just serving the folder as is on the test domain specified, there needs to be a place to put the provisioner, and the logs, config files, etc

Another problem is XDebug, if your folder only contains wp-content, you lose all the debugging information inside WP core, making debugging much harder

This is already the case, they add a site to vvv-custom.yml that references a git repo, and VVV clones it into the appropriate place and runs the provisioners.

That was pretty much the answer I was looking for, thanks :-)

I'm not trying to do anything exotic, I just have the one Wordpress project that we're migrating away from and I needed a way to be able to edit without being bothered setting up lamp stacks or any such thing. Just clone on workstation x, edit some files using Vim and run a wp-content based deploy script. And push changes. Rinse and repeat on workstation Y.

Man..., I'm taking a look at VVV today, 5 years later... And I still don't understands how I'm supposed to version control my projects into it. If /www/* is in .gitignore, how I'm supposed to version control my projects? I need to do it inside the virtual machine - so I can't benefit from git tools in VSCode/Atom, for example?

(PS: I'm feeling extremely dumb to going back here and have the same doubt as 5 years ago)

You don't, VVV isn't a starter template you modify like underscores and the
www folder isn't a generic public_html you dump stuff into

Creating a site then doing a git clone into it after a provision is
perfectly possible and happens everyday.

So:

  • grab a copy of VVV
  • provision it
  • go to one of the installs it created
  • add your stuff

If your stuff just happens to be a git repo of a wp-content folder then
great, open it up in Atom and use all your usual tools. Just as you would
with MAMP or any other local Dev environment.

As for why the www folder is ignored, well you wouldn't want to add your
files to VVV core would you? Then you wouldn't be able to update, either
that or all VVV users get your files. You can have different git repos in
that folder they don't have to be all under the same repo.

Additionally, VVV isn't something you set up over and over again for each
project. You only need one copy of VVV, and the www folder can have
multiple sites representing multiple projects

On Fri, 7 Jun 2019 at 23:26, Allyson Souza notifications@github.com wrote:

Man..., I'm taking a look at VVV today, 5 years later... And I still don't
understands how I'm supposed to version control my projects into it. If
/www/* is in .gitignore, how I'm supposed to version control my projects?
I need to do it inside the virtual machine - so I can't benefit from git
tools in VSCode/Atom, for example?

(PS: I'm feeling extremely dumb to going back here and have the same doubt
as 5 years ago)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Varying-Vagrant-Vagrants/VVV/issues/508?email_source=notifications&email_token=AAAOLZYGE4RPF2NAJZ2FDH3PZLOCLA5CNFSM4AXYOTB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXHESMY#issuecomment-500058419,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAOLZ5KUCHMECVKA447PMTPZLOCLANCNFSM4AXYOTBQ
.

Also you don't need to use the tools from inside the virtual machine. Sites
are in shared folders they exist in both the host and the guest. To edit a
file in VVV you just navigate to the folder in Finder/explorer and double
click on it

On Fri, 7 Jun 2019 at 23:33, Tom Nowell contact@tomjn.com wrote:

You don't, VVV isn't a starter template you modify like underscores and
the www folder isn't a generic public_html you dump stuff into

Creating a site then doing a git clone into it after a provision is
perfectly possible and happens everyday.

So:

  • grab a copy of VVV
  • provision it
  • go to one of the installs it created
  • add your stuff

If your stuff just happens to be a git repo of a wp-content folder then
great, open it up in Atom and use all your usual tools. Just as you would
with MAMP or any other local Dev environment.

As for why the www folder is ignored, well you wouldn't want to add your
files to VVV core would you? Then you wouldn't be able to update, either
that or all VVV users get your files. You can have different git repos in
that folder they don't have to be all under the same repo.

Additionally, VVV isn't something you set up over and over again for each
project. You only need one copy of VVV, and the www folder can have
multiple sites representing multiple projects

On Fri, 7 Jun 2019 at 23:26, Allyson Souza notifications@github.com
wrote:

Man..., I'm taking a look at VVV today, 5 years later... And I still
don't understands how I'm supposed to version control my projects into it.
If /www/* is in .gitignore, how I'm supposed to version control my
projects? I need to do it inside the virtual machine - so I can't benefit
from git tools in VSCode/Atom, for example?

(PS: I'm feeling extremely dumb to going back here and have the same
doubt as 5 years ago)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Varying-Vagrant-Vagrants/VVV/issues/508?email_source=notifications&email_token=AAAOLZYGE4RPF2NAJZ2FDH3PZLOCLA5CNFSM4AXYOTB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXHESMY#issuecomment-500058419,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAOLZ5KUCHMECVKA447PMTPZLOCLANCNFSM4AXYOTBQ
.

Thanks @tomjn! Finally I understood, I was thinking I couldn't use my usual multiple repo's like in XAMPP or any other environment cloning in www since it's ignored in .gitignore, but it's ignored for vvv, and that's good! I can clone all my projects after provisioning or add provision scripts to it and then, finally, after 5 years, migrate from XAMPP >.<

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings