Tuesday, 18 October 2016

bashrc cool tips

# git commit push all modified files
gcpa() {
    echo "Commit Message: $1"

    echo "Commiting.................."
    git commit -am "$1"

    echo "Pushing...................."
    git push

    echo "Done......................."
}


example:
$ gcpa "Added logs"

# commit single file with msg
# equivalent to add, commit, push
gcpm() {
    echo "Committing: $1"
    echo "Message: $2"

    echo "Adding.................."
    git add "$1"

    echo "Commiting.................."
    git commit -m "$2"

    echo "Pushing...................."
    git push

    echo "Done......................."
}

# example
$ gcpm abc.py "Added exception handler"

No comments:

Post a Comment