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
If you have changes or additions to the VVV install you will get an error…
[email protected][~/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
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.
Then check if your repo is clean…
Now you can pull down the later version
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.
vagrant up --provision
Now your VVV is up to date