Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaChandra
Created May 19, 2022 17:43
Show Gist options
  • Save ChaitanyaChandra/88e127d2e076b23315382ce249360d89 to your computer and use it in GitHub Desktop.
Save ChaitanyaChandra/88e127d2e076b23315382ce249360d89 to your computer and use it in GitHub Desktop.
automatic git commit. commit should be like this : automatic commit #1
# add this alias text on your ~/.bashrc file or ~/.zprofile
alias gitp="source ~/gitp.sh"
# create file in home dir with this content ~/.gitp.sh
FILE=~/.count
git_push () {
variableCount=$(cat ~/.count)
git add .
echo $(($(cat ~/.count) + 1)) > ~/.count
git commit -m "automated commit #$variableCount"
git push
}
if [ -f $FILE ]; then
git_push
else
echo "0" > ~/.count
git_push
fi
@ChaitanyaChandra
Copy link
Author

ChaitanyaChandra commented May 19, 2022

you must use gitp to push. not automatic though. automated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment