DEV Community

Discussion on: What are your UNIX pipeline commands that saved you from lot of coding/time?

Collapse
 
benjaminconnelly profile image
Benjamin Connelly • Edited

Having a shortcut to add and commit is priceless. I use this function with a useful commit message and commit often.

$lg "My useful description"
# Lazy Git
function lg() {
    git add .
    git commit -a -m "$1"
    git push
}
# End Lazy Git
Collapse
 
tasmo profile image
Tasmo

This might be very dangerous if you don't git pull after your commit. So I suggest:

# Lazy Git
function lg() {
    git add .
    git commit -a -m "$1"
    git pull
    git push
}
# End Lazy Git
Thread Thread
 
benjaminconnelly profile image
Benjamin Connelly

Thank you! I have updated my function.