File: commit-if-modified.sh

package info (click to toggle)
node-tap-parser 13.0.1%2B~cs4.1.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,176 kB
  • sloc: javascript: 275; sh: 48; makefile: 30
file content (13 lines) | stat: -rw-r--r-- 282 bytes parent folder | download | duplicates (34)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash
git config --global user.email "$1"
shift
git config --global user.name "$1"
shift
message="$1"
shift
if [ $(git status --porcelain "$@" | egrep '^ M' | wc -l) -gt 0 ]; then
  git add "$@"
  git commit -m "$message"
  git push || git pull --rebase
  git push
fi