Created
October 10, 2022 06:43
-
-
Save ashavijit/2da1706b020d59c55722d01cb155141e to your computer and use it in GitHub Desktop.
You Know I am too lazy to follow-up so called git-protocols so added a shell-script to push my code ... --->
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
| #!/bin/bash | |
| current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
| git pull origin $current_branch | |
| echo "=== pull changes from '$current_branch' branch ===" | |
| msg="$1" | |
| if [[ -z "${msg//}"]] | |
| then | |
| msg=$(date '+%Y-%m-%d %H:%M:%S') | |
| fi | |
| git add . | |
| echo "====staged all git files" | |
| git commit -m "$msg" | |
| echo "====committed changes with message '$msg'" | |
| git push origin $current_branch | |
| echo "====pushed changes to '$current_branch' branch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment