DEV Community

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

Collapse
 
r0f1 profile image
Florian Rohrer

The Just Commit Everything command:

alias gitasdf='git add -A && git commit -m asdf && git push'
Collapse
 
msoedov profile image
Alex Miasoiedov

Why do you use git? Just use dropbox

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.

Collapse
 
djviolin profile image
István Lantos

I have something similar, but I'm inserting a timestamp as a commit message. Still totally useless. :)

I also replaced origin word in the git repo creation at git remote add gitlab .... So if I pushing something to gitlab, I use the gitlab command, which using git push -u gitlab --all. I have similar to Github.