Skip to content

Instantly share code, notes, and snippets.

@micky2be
Last active September 25, 2017 02:39
Show Gist options
  • Save micky2be/49f6db30aa4b6e927eaf0bf78b12c559 to your computer and use it in GitHub Desktop.
Save micky2be/49f6db30aa4b6e927eaf0bf78b12c559 to your computer and use it in GitHub Desktop.
Global gitignore

gitignore

Everybody is using a different IDE or system.
We will not add all those different files to every projects we have in our company.
The best way to deal with this is for everyone to be responsible of there noisy file by adding a global .gitignore file.

To do so it's fairly simple, just create a file under ~/.gitignore and then put all you noisy files in there, or simply download an existing file you may have found on internet (like this one).
Then simply run the following command to add the file to your global config.

git config --global core.excludesfile ~/.gitignore

project using node

.nvmrc

Setting the node version the project is running on in a .nvmrc file will help developers and CI to easily switch to the correct node version by simply running nvm use or nvm install. The latter will install the wanted node version if not present or simply use the wanted version.

.npmrc

Setting up the3 config for npm through a .npmrc file would allow everyone to use the same config such as using the prefix ~ for version, auto commit message for npm version and more.

dependencies

npm run clean

Clean dependencies folders.

npm run install

Install all dependencies. For example combine npm and bower install.

npm run deps

Create a script called deps to be able to clean and install all deps.
Can be very usefull when switching branches with big refactoring. One would not need to worry about what to clean and what to install.

linter

Whatever if you use JavaScript, TypeScript or even CoffeeScript you should setup a linter. Same goes with CSS (even LESS or SASS). This is mostly to set of standards for the writing and design the code. Following a consistent style both helps enforce this concept and improves the overall quality of the code we write. This facilitates other developers stepping in to assist with maintenance more easily and can certainly save time in the long haul.

commits and changelog

Using a convention for commit messages would help clarity when once read them. Also it will allow to easily generate a changelog whenever needed. When releasing a new version this is when we should generate the changelog with an easy and clever way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment