Git Bash Scripting
Jan 17, 2019
Here are some useful git command for bash scripting
Uncommited Changes:
1 | if ! git diff-index --quiet HEAD --; then |
Remote exists:
1 | git remote -v | /usr/bin/awk '{print $1}' | /usr/bin/grep -w ${ORIGIN_REMOTE} >/dev/null 2>&1 |
Local Branch Exists:
1 | git rev-parse -q --verify ${branch} >/dev/null 2>&1 |
