LoginSignup
4
6

More than 5 years have passed since last update.

vagrantとlocalを同期させる方法

Last updated at Posted at 2017-04-06

前提: vagrantをinitさせておいてVagrantfileがあること

Vagrantfile
config.vm.synced_folder "ローカルのパス", "vagrantの同期させたいパス"
↓
EX)
config.vm.synced_folder "C:/git", "/var/www/html"

上記を行うと、ローカルにある"C:/git"配下にあるものが、
vagrantにある"/var/www/html"に同期させる。

以下のように、カンマ区切りでオプションの設定もできる。

Vagrantfile
EX)
config.vm.synced_folder "C:/git", "/var/www/html",
:owner => "nginx",
:group => "nginx",
:mount_options => ['dmode=777', 'fmode=777']
4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6