Search code examples
githubvagrantdevelopment-environment

Which folder or files created in vagrant should not be push in a repository on GitHub


I would like to create a vagrant with some utilities installed, such like a configured LAMP, npm installed, etc... and later doing a push in a public github account.

I should create a .gitignore file with which restrictions? A simple vagrant project have this structure:

  • .vagrant (folder).
  • html (folder).
  • vagrantfile (file).

And I don't want some script shell for install the utilities when the user run vagrant up. For that I want to share an environment with everything and installed via vagrant ssh.


Solution

  • You definitely want your Vagrantfile. That's what defines your Vagrant environment. And you almost certainly want to ignore .vagrant/.

    gitignore.io seems to agree:

    # Created by https://www.gitignore.io/api/vagrant
    
    ### Vagrant ###
    .vagrant/
    

    You might also want to use this utility with the rest of your stack, e.g. here is a .gitignore generated for Composer, NodeJS and Vagrant.