Skip to content

Instantly share code, notes, and snippets.

@atfzl
atfzl / setup.sh
Last active September 3, 2016 10:45
Post Commit setup steps
#!/bin/bash
# directory for storing branch specific gitignore files
mkdir .gitignores
# empty file for production branch
touch .gitignores/production
# ignore build on any other branch
echo "build" >> .gitignores/default
@atfzl
atfzl / post-commit.js
Created September 3, 2016 10:36
use branch specific git ignore configs
#!/usr/bin/env node
var execSync = require('child_process').execSync;
var exec = function (command) {
return execSync(command, { pwd: '../../', encoding: 'utf8' });
};
// get current branch name as single value
var currentBranch = exec('git rev-parse --abbrev-ref HEAD').trim();