5 file types you should and 10 you should not store in your VCS?

Mateusz Lubański
May 13 · 2 min read

5 file categories you should store

As you already get familiar with what VCS is, you understood basic concepts and selected which version control system tool you like to use, it is time to consider what actually you should store in it:

  1. source code files such as .java, .sql, .js, .html, .css
  2. build tool configuration files such as mvn.xml, build.gradle, package.json
  3. DevOps tools configuration such as Dockerfile, Jenkinsfile, Vagrantfile,
  4. infrastructure code required to install and run your software such as: Bash, Ansible, Terraform scripts
  5. other text formatted documents such as README, LICENSE and documents written in markup languages

10 file categories you should ignore

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are

  1. dependencies → those dependencies should be resolved through build tools like mvn, gradle, npm
  2. dependency caches, such as the contents of /node_modules or /packages
  3. compiled code, such as .o, .pyc, and .class files
  4. build output directories, such as /bin, /out, or /target
  5. files generated at runtime, such as .log, .lock, or .tmp
  6. files generated during build process → this avoid situation that someone will try modify generated file
  7. hidden system files, such as .DS_Store or Thumbs.db
  8. personal IDE config files, such as .idea/workspace.xml
  9. non text based documentation as .pdf, .docx, .xlsx, .pptxit’s better to use some wiki software or specialized products like Google Docs or Microsoft Office 365
  10. sensitive information

How your VSC can help you ignore files?

The list of files to ignore is usually kept in a simple file called “.*ignore” in the root folder of your project such as .gitignore for GIT or as an directory properties in SVN. It’s highly recommended to define this list at the very beginning of your project — before making your first commit. Because once files are committed, you’ll have to jump through some hoops to get them out of version control, again.

A helpful compilation of ignore rules for different projects and platforms can be found here: github.com/github/gitignore or it could be generated under: https://www.gitignore.io/


Faun

The Must-Read Publication for Aspiring Developers & DevOps Enthusiasts

Mateusz Lubański

Written by

DevOps & Software Engineer focused on how to improve, scale and automate software development processes. In privite time love sport, nature, travels and salsa

Faun

Faun

The Must-Read Publication for Aspiring Developers & DevOps Enthusiasts