How to update VVV for WordPress | Varying Vagrant Vagrants
I noticed that my version of VVV or Varying Vagrant Vagrants was older than the current release and started to look into how to update VVV safely as I have done some customisations to it and added some additional files to the VVV main directory.
Move into your local VVV directory, halt vagrant and run git pull
vagrant halt
git pull
If you have changes or additions to the VVV install you will get an error…
neilg@[~/dev]:(develop) git pull Cannot pull with rebase: You have unstaged changes. Please commit or stash them.
Have a look at what the changes are by running git status
git status
So we have to run git stash first to store our changes first, this will remove them so we can sync the git repo with the later version and then we use git stash apply to bring them back. As for any added files, just don’t add them via git, leave them untracked, these along with all your sites will still be in the same location after you have successfully run git pull.
git stash
Then check if your repo is clean…
git status
Now you can pull down the later version
git pull
Then reapply your changes
git stash apply
You may get a merge conflict here, solve the conflict by looking at the file in question resolve the difference and then use git add to the file to remove the conflict.
Finally run
vagrant up --provision
Now your VVV is up to date
Thanks for this. But how can I check my current version of VVV?
you can run…
git describe --tags
Hey thanks a lot for that–it worked. I couldn’t find that info anywhere.
I have a follow-up question about your instructions. I followed all steps, and they worked as expected, until the final step: git stash apply. As you mentioned, I received a conflict error:
$ git stash apply
CONFLICT (modify/delete): www/vvv-hosts deleted in Updated upstream and modified in Stashed changes. Version Stashed changes of www/vvv-hosts left in tree.
For a beginner like me, can you walk me through the steps you suggest to resolve this:
>> solve the conflict by looking at the file in question resolve the difference and then use git add to the file to remove the conflict.
I can open the file in-question. But how exactly do I ‘resolve the difference?’
Also, why am I encountering this error? I thought the point of ‘git stash apply’ was to re-apply any changes I had made to these files?
Thanks!
PS — Just as an FYI, I did not receive an email confirmation when you posted your reply. I even checked my spam folder. This time I’ve made sure to tick both ‘Notify’ boxes. Let’s see if I receive one this time.
That’s a generic git task, you fix the file to how it’s supposed to be, hence ‘resolving the conflict’, save it, then do the git add. Git puts theirs and your version in the file and asks you to pick or edit until it’s how it’s supposed to be
Also, VVV should report which version it is, but if you’re not running latest, then you’re out of date. `git pull` should say no changes were pulled down if you’re up to date.