19 lines
403 B
Bash
Executable file
19 lines
403 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
main() {
|
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
echo "forge-as.sh: forge a Git commit as a user." >&2
|
|
echo "usage: $0 'Author Name' author@email.tld" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Forging a Git commit as $1 <$2>..."
|
|
|
|
git add -A
|
|
GIT_AUTHOR_NAME="$1" GIT_AUTHOR_EMAIL="$2" git commit --signoff --author="$1 <$2>"
|
|
git push -u origin main
|
|
}
|
|
|
|
main "$@"
|