DEV Community

Discussion on: Stage. Commit. Push. A Git Story (Comic)

Collapse
 
okdewit profile image
Orian de Wit • Edited

If you're a lazy postcard mailer like me, you can also do everything at the same time.

If you're using the command line, you can add an alias like this, which does both staging and committing and pushing:

alias c='git commit -am $1 && git push origin HEAD'

You can chain commands together with &&, and access passed parameters using $@ (everything) and $1 (first parameter).

I do a lot of little single-commit bugfixes, so one of my most used command line aliases moves my current changes to a new branch, stages and commits, pushes the branch, and opens the page on GitHub to create a PR.

As a developer, one of the most amazing things is how creative you can get in automating your own workflow!

Collapse
 
erikaheidi profile image
Erika Heidi

Wow, this is awesome. Thanks for sharing! 😊