Add custom settings to a repository

.gitattributes is a file you can add to your git project. It must be created in the root of the repository and committed like any other file It allows customisation of a lot of parameters.

  • Define file types diff format
  • Define which file types are binary
  • Configure line ending character
  • Ignore some files in export
  • ...

The functionality I currently find the most valuable is export-ignore. It allows you to exclude some files from the package you will be able to download from GIT front-end (Github, Stash, Bitbucket,...).

puphpet export-ignore
slicing export-ignore
tools export-ignore
Vagrantfile export-ignore
.gitattributes export-ignore
.gitignore export-ignore
readme.md export-ignore
www/install.php export-ignore

This example will exclude

  • Vagrant configuration files
  • Some folders containing not deployable code
  • Git configuration files
  • readme file
  • Drupal install file

Ensure your .gitattributes files are properly configured so that your exported package only contains what needs to be pushed live.

Read more about .gitattributes