mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Added -s --soft arguments as well. Default roll-back one with HEAD^ and only using ~ if commit count more than 1. Added auto complete. Updated documentation. Attitude adjustment: don't throw errors and say NO as suggested in #114, have a can do attitude instead, leave the errors up to git to report.
20 lines
318 B
Bash
Executable file
20 lines
318 B
Bash
Executable file
#!/bin/sh
|
|
|
|
back="^"
|
|
|
|
case "$1" in
|
|
-h|--hard)
|
|
test $2 -gt 1 > /dev/null 2>&1 && back="~$2"
|
|
git reset --hard HEAD$back && exit 0;
|
|
;;
|
|
-s|--soft)
|
|
test $2 -gt 1 > /dev/null 2>&1 && back="~$2"
|
|
;;
|
|
*)
|
|
test $1 -gt 1 > /dev/null 2>&1 && back="~$1"
|
|
;;
|
|
esac
|
|
|
|
git reset --soft HEAD$back
|
|
git reset
|