Hacker News new | past | comments | ask | show | jobs | submit login

Personally, I find these aliases a bit too terse.

Aliases are important for enhanced productivity, but shell aliases are too much. I find these git aliases much more comfortable:

    alias.st=status
    alias.co=checkout
    alias.com=checkout master
    alias.cam=commit -a -m
    alias.cm=commit -m
    alias.br=branch
push, pull, merge, rebase and the rest are infrequently used, so I don't alias them at all. Using shell aliases (as opposed to git aliases) is unjustified IMO, as is the horrible

    alias g='git'
which gives me the creeps.



Why do shell aliases make you uncomfortable? If we are talking about your personal machine, and not a server where another user can be bitten by not understanding your personal alias preferences, what could the harm be?


I use the g=git alias :) Are there any negative consequences I should be aware of?


Tab-completion via git-completion.bash won't work. I think you can add the following at the end of git-completion.bash to fix it, though:

  complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \
    || complete -o default -o nospace -F _git g


Tab-completion on my zsh setup still works. I'm not sure why.


I quite agree. Here are my git aliases:

        stat = status
        stta = status
        satt = status
        tat = status
        co = checkout
        fo = fetch origin
        ff = merge --ff-only
        ffo = merge --ff-only @{u}
        po = push origin HEAD


just another one

alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"


I have a similar thing in my .gitconfig:

    [alias]
      rm-a  = "!git ls-files -z --deleted | xargs -0 git rm"


Why not add -u?


Mercurial accepts unique prefixes to commands by default. (For example, hg me is the same as hg merge.) Hg wins again!




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: