My favorite is git h, which produces a nicely summarized log of commits on the current branch, with some highlighting and relative dates:

[alias]
    h = log --graph  --abbrev-commit --date=relative --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'

What’s your favorite Git alias?

  • @canpolatM
    link
    English
    21 year ago

    The aliases I use the most are these:

    st = status
    co = checkout
    lg = log --color --graph --date=short --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' --abbrev-commit
    

    I see that my lg is almost identical to your h. I didn’t write mine either.

    I have some other aliases (mostly for log) but I rarely use them.

    • Jason NovingerOPM
      link
      English
      11 year ago

      At this point, I don’t even remember what the h stood for, my brain just knows which fingers to move to do the thing to see the history. 🤦

      • @canpolatM
        link
        English
        21 year ago

        “history” maybe? Same here, it’s mostly muscle memory. When I temporarily have to work on a different PC without my aliases, I feel like everything is in slow motion :)