Skip to content

Comment on Announcing gitsh: A dedicated shell for git commandsparent

Comments

    $ cat ~/.alias
    alias g='git'

    $ cat ~/.gitconfig
    [alias]
      st = status
      br = branch
      co = checkout
I don't see anyone else doing g='git' but I don't have to write out an alias for each command. For less frequently used git commands I forget an [alias] shortcut but I can always use the 'g' shortcut.

If you want to keep bash completion on working when having git aliased to g, try to add this line to your .bashrc:

  # Complete aliased git, too.
  complete -o default -o nospace -F _git g

I was curious about this, so I checked: zsh will preserve completions if you `alias g=git`.

Yes, I use it too! Saves me a lot of time.

  $ cat ~/.bash_profile | grep git
  alias gco="git checkout"
  alias gpu="git pull"
  alias gcom="git commit"
  alias gfr="git fetch && git rebase -i"
  alias g="git"

For people using oh-my-zsh, the git plugin has similar ones and quite a few more handy ones.

https://github.com/robbyrussell/oh-my-zsh/blob/master/plugin...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.