File: commit-if-modified.sh

package info (click to toggle)
node-lru-cache 10.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 944 kB
  • sloc: javascript: 546; sh: 90; makefile: 15
file content (13 lines) | stat: -rw-r--r-- 282 bytes parent folder | download | duplicates (47)
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