Vagrant,似乎是一个缓慢的开发过程

Vagrant, Seems like a slow developing process

我不确定我是否正确理解了 vagrant,但根据我的理解,它就像您计算机上 VM 中的服务器 运行,您使用它而不是本地主机来检查东西是否正常工作,因为您本地设置与您的服务器略有不同。然而,检查更新的最快方法是 git 从您的本地电脑推送,然后 git 拉动您的 vagrant VM 然后在您的本地电脑上加载网站以查看更改,看起来它会变成与本地主机 CTRL+S f5 本地主机网站相比,一段时间后的痛苦过程。

我会尝试给出一些提示:

its like a server running in a VM on your computer

Vagrant 不是服务器,它是管理计算机上 VM 的工具,它可以帮助您启动、配置、停止或销毁 VM。它抽象了您正在使用的提供商(virtualbox、vmware、云提供商或其他提供商),并使其成为您所有团队成员的单一工作流程。

However is the quickest way to check updates, to git push from your local pc, then git pull on your vagrant VM then load up the website on your local pc to see changes

不确定您在做什么,但很可能,sync folder should help you avoid doing that. I already explain here您如何使用同步文件夹

基本上,当您使用同步文件夹时,当您从主机修改文件时,相同的文件也会在虚拟机上修改,所以您不需要所有 git 东西。变化不会立即发生,但大多数人都能适应。

例如,您可以添加

config.vm.synced_folder "/Users/fhenri/project/examples/vagrant/ssh/www", "/var/www"

这会将我的本地文件夹 /Users/fhenri/project/examples/vagrant/ssh/www 映射到 vm 文件夹 /var/www

Vagrant, Seems like a slow developing process

这可能是真的,有一些博客(暂时不要检索它们)处理这个问题。那么解决方案是什么?

取决于您尝试使用 vagrant 复制的基础架构,但如果您是单个开发人员,您可以查看 docker, if you're not confortable with docker, vagrant can really support you there and you can declare docker as vagrant provider,同样有一些博客 post 处理了一些基准测试,如果你与流浪表现作斗争,你真的可以受益。

希望对您有所帮助