Lurker News
I really enjoy using a command-line interface instead of a graphical user interface, and was wondering if anyone had any solid recommendations for applications that one can use in a terminal window.

Comments (385) 158 threads

Show all comments

Showing thread 11 of 158

ivan_ah2 replies#
youtube_dl an ffmpeg would be my top two in terms of power.

Here are my top commands by frequency of use:

    4421 git
     952 open
     936 vim
     908 cd
     603 ls
     566 grep
     533 cp
     429 rm
     414 mv
     250 atom
     247 pip
     233 mkdir
     223 fab
     163 docker
     130 touch
     128 find
     123 youtube-dl
     113 python
     103 ssh
     100 cat
      99 wget
      81 pytest
      75 brew
total is of ~16k history lines... this means one in ever 4 commands I type is git! Wow I didn't know that. Probably `git status`...
adtac8 replies#
I use git so much that I made these aliases in zsh:

    alias g="git show"
    alias gh="git show HEAD"
    alias gs="git status"
    alias gl="git log"
    alias gco="git checkout"
    alias gd="git diff"
    alias gbl="git branch -v"
    alias gbd="git branch -D"
    alias gri="git rebase --interactive"
    alias grc="git rebase --continue"
    alias gra="git rebase --abort"
    alias gst="git stash"
    alias gsta="git stash apply"
    alias gx="gco -- \*; git reset HEAD \*"
    alias gcp="git cherry-pick"
    alias gcpc="git cherry-pick --continue"
    alias gcpa="git cherry-pick --abort"
A few hundred instances of "gs" in my .zhistory :)
ryannevius1 reply#
I find that...

    alias glol="git log --oneline"
...comes in handy as well, and it's fun to type.
RichardCA#
Try this one sometime...

  alias lg = log --date=format:'%Y-%m-%d %H:%M:%S' --pretty=format:'%cd %<(20,trunc)%an %C(auto)%h%Creset%C(auto)%d%Creset %s'
lloeki1 reply#
I find my git graph, git save, and git lint (also, git fetch --prune but lo alias for that one) extremely useful.

Aliases in my ~/.gitconfig:

    [alias]
        co = checkout
        cm = !git add -A && git commit
        br = branch
        ci = commit
        st = status
        unstage = reset HEAD --
        recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
        overview = log --all --oneline --no-merges
        recap = !git log --all --oneline --no-merges --author=${1-$(git config user.email)}
        today = !git log --all --since=00:00:00 --oneline --no-merges --author=${1-$(git config user.email)}
        changelog = !git log --oneline --no-merges ${1-$(git describe --abbrev=0)}..HEAD
        upstream = !git log --oneline --no-merges HEAD..${1-$(git branch -lvv | perl -ne '/^\\*.*\\[(.*?)\\]/ and print "$1\n"')}
        local = !git log --oneline --no-merges ${1-$(git branch -lvv | perl -ne '/^\\*.*\\[(.*?)\\]/ and print "$1\n"')}..HEAD
        graph = log --oneline --graph --all --decorate --date=iso
        save = !git add -A && git commit -m 'SAVEPOINT'
        undo = reset HEAD~1 --mixed
        backup = !git push origin/backup/$(whoami)/$(git branch)
        lint = !git branch --merged | grep -v \"^\\s*master$\" | grep -v \"\\*\" | xargs -n 1 git branch -d
kippfe#
Thanks for the tip.. :)
klatys2 replies#
nice ones! couple from my bash_alias

    alias ..="cd .."
    alias ..2="cd ../.."
    # ... you get the idea, mine goes up to 5
    function mkcd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
    alias h="history|grep"
bpmckenna#
Instead of your `..` aliases, I have this, which saves some copy-pasting.

    function up() { cd "$(printf '../'%.0s $(seq 1 "${1:-1}"))" && pwd; } #up 4 goes up 4 directories
sfdgsdfg#

    alias ...="cd ../.."
    alias ....="cd ../../.."
bhrgunatha#
The oh-my-zsh git plugin [1] aliases have become second nature.

No need to install oh-my-zsh you can just take the file or cherry pick (!) the useful ones.
I may drop oh-my-zsh completely and just set up zsh with the small subset of plugins I use.
[1] https://github.com/robbyrussell/oh-my-zsh/tree/master/plugin...

brbrodude#
hahah I have gs and gb(branch), just because I'm just constantly typing them(sometimes for no reason at all), others I end up typing the full commands tho
codetrotter#
I’ve been using short aliases for my most frequently used git commands for a few years now. I can’t imagine not using aliases.

  alias st='git status'
  alias dp='git diff'
  alias di='git diff --cached'
  alias aa='git add -A'
  alias cm='git commit -m'
  alias pu='git push'
Having these aliases of mine makes these actions something that you don’t need to spend any mental effort to perform at all.

I highly recommend others to define aliases that make sense to them for the most used got commands.
Mine are named the way they are because the two letter alias represents how I think of the action that the command performs:
* st - status
* dp - diff pending
* di - diff
* aa - add all
* cm - commit
If you define your aliases this way (speaking to the other readers of this thread, not the person I am replying to), you will find that the combinations become muscle memory quickly.
Notice also that unlike a lot of other people including the person I am replying to, my aliases are not prefixed with “g”. Again this boils down to your personal way of thinking. I’ve used other version control systems before, switched to git several years ago, and use git pretty much exclusively. I am of course aware at all times that I am working with git, but at the same time when I think of actions to perform, I don’t think of them as “git this or that”, I only think of the “this or that” part. If that makes sense :P
But yeah, find aliases that work and make sense for you.

janlaureys#
I use of few of these as well as alias stage="git add -A && git status" alias unstage="git reset HEAD && git status"
andersonvom1 reply#
gitsh - https://github.com/thoughtbot/gitsh

Since git is by far the command a lot of people type the most, this shell comes in really handy. It supports all regular git aliases, has autocompletion, and you can set default commands to be run when you just press return. It's amazing how much typing it saves.

ufmace#
+1 to Gitsh. Feels like it saves a massive amount of typing.