Skip to content

Instantly share code, notes, and snippets.

@simbafs
Last active March 28, 2019 13:23
Show Gist options
  • Save simbafs/d6d60e23e1fc52ba33ede33ba02ada24 to your computer and use it in GitHub Desktop.
Save simbafs/d6d60e23e1fc52ba33ede33ba02ada24 to your computer and use it in GitHub Desktop.
ok
#!/bin/bash
computer="/home/simba/git/"
termux="/data/data/com.termux/files/home/git"
until [[ -d .git ]] ; do
if [[ $pwd = $computer ]] ;then
break
fi
cd ..
done
[ -z $1 ] && message="change something" || message=$1
[ -z $2 ] && respository="origin" || respository=$2
cat <<HERE_DOCUMENT
> git add .
> git commit -m "$message"
> git push "$respository"
> [Y/n]?
HERE_DOCUMENT
read ans
if [ "x${ans}" = "xy" ] || [ "x${ans}" = "xY" ] || [ "x${ans}" = "x" ]; then
git add --all . &&
git commit -m "$message" &&
git push "$respository"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment