Skip to content

Instantly share code, notes, and snippets.

@augustogiles
augustogiles / archive_branches.sh
Last active April 3, 2024 17:21
Based in a branch, all the branches that already merged in it is passive to be archived.
#!/usr/bin/env bash
current_branch=$(git rev-parse --abbrev-ref HEAD)
target_branch=$1
if [ -z "$target_branch" ]
then
target_branch=$current_branch
fi
response="DECIDE"
@augustogiles
augustogiles / pre-commit-eslint
Created March 1, 2020 12:37 — forked from linhmtran168/pre-commit-eslint
Pre-commit hook to check for Javascript using ESLint
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true