Created
May 19, 2022 17:43
-
-
Save ChaitanyaChandra/88e127d2e076b23315382ce249360d89 to your computer and use it in GitHub Desktop.
automatic git commit. commit should be like this : automatic commit #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this alias text on your ~/.bashrc file or ~/.zprofile | |
alias gitp="source ~/gitp.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you must use
gitp
to push. not automatic though. automated.