You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
buha.de/push.linux.sh

39 lines
1.0 KiB

#!/bin/bash
# check if user has configured a name in git and set it, if not
if ! grep name ~/.gitconfig && ! grep name ~/.git/config; then
echo "You need a name! It is not important. If you choose none, it will be 'buha'."
echo "Write 'exit' or press 'Strg+c' to cancel."
read -p ": " name
if [ "${name}" == "exit" ]; then
exit
fi
if [ "${name}" == "" ]; then
name="buha"
fi
git config user.name "${name}"
fi
# check if user has configured an email address in git and set it, if not
if ! grep email ~/.gitconfig && ! grep email ~/.git/config; then
echo "You need an email! It is not important. If you choose none, it will be 'info@bunteshaus.de'."
echo "Write 'exit' or press 'Strg+c' to cancel."
read -p ": " email
if [ "${email}" == "exit" ]; then
exit
fi
if [ "${email}" == "" ]; then
email="buha"
fi
git config user.email "${email}"
fi
if ! grep rebase ~/.gitconfig && ! grep rebase ~/.git/config; then
git config pull.rebase true
fi
# update from upstream/main
git pull --rebase upstream main && \
# send own changes
git push origin