Magento2 .gitignore reference

Magento include a base .gitignore file with the Magento Open Source project repository. See the latest Magento .gitignore file. If you need to add a file that is in the .gitignore list, you can use the -f (force) option when staging a commit:

 

Nice and clean one 

/*

!.gitignore
!composer.json
!composer.lock
!bitbucket-pipelines.yml

!/app
/app/*
!/app/code
!/app/design

!/app/etc
/app/etc/env.php

!/vendor
/vendor/*
!/vendor/Vendor1
!/vendor/Vendor2


!/app/i18n

node_modules/
npm-debug.log
.DS_Store
*._*
.nfs.*