DEV Community

Discussion on: Using Aliases to Speed Up Your Git Workflow

Collapse
 
robertcoopercode profile image
Robert Cooper

Not everybody loves aliases

This is true. I worked with a guy that refused to use aliases because he thought he would forget the underlying command behind the alias.

Collapse
 
jbristow profile image
Jon Bristow • Edited

It’s less that and more having your muscle memory be completely wrong as soon as you ssh somewhere.

Aliases are ok... but anyone with a bloated vimrc file can tell you how strange it feels to use the defaults. (Seriously, using vim-surround is basically the main reason I still use vim)

EDIT: and typing git commands are a very small part of my workflow, so it seems wasteful to alias them. And I will absolutely never add -A... I’m too paranoid about committing something I didn’t mean to.

Thread Thread
 
codeandclay profile image
Oliver

I don't have many aliases for git commands but seeing git add -A has inspired me to add one more to my small list:

alias gip='git add ${FILE} -p'

As in: git add file.rb -p. The -p flag tells git that you want to select which individual lines/hunks get committed. It's the scalpel to -A's mallet.

The alias allows me to do it this way: gip file.rb

Thread Thread
 
jbristow profile image
Jon Bristow

SInce i work in feature branches that get squash merged in a few days, I don’t really understand why you would be doing more than one thing at once...

Thread Thread
 
jessekphillips profile image
Jesse Phillips

I don't think squash merge should exist. The commit message sucks, many times your feature can be good individual changes (valuable outside the feature) it is pretty easy to finalize the order and squash with a rebase --interactive.

I'm said --fixup isn't listed as as alias.

Collapse
 
alainvanhout profile image
Alain Van Hout

My general opinion is very much 'use whatever works best for you'.

For me personally though, aliases like this are equivalent to improving the speed/performance of your car by speeding up how quickly you can get into and out of the car.