Skip to content

Instantly share code, notes, and snippets.

Created February 17, 2014 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/9053693 to your computer and use it in GitHub Desktop.
Save anonymous/9053693 to your computer and use it in GitHub Desktop.
Which git commands do you use most?
history -w /dev/stdout | grep -o "^git [a-Z]*\( -\{1,2\}\([a-Z]\)*\)*" | sort | uniq -c | sort -rg
@romankierzkowski
Copy link

 49 git status -s
 15 git commit -am
 12 git push
 11 git checkout
 10 git add
  7 git branch
  5 git rm
  5 git mv
  5 git diff
  3 git rm --cached
  3 git rebase
  3 git commit -m
  3 git checkout -b
  2 git rm -r --cached
  2 git clone
  2 git branch -v
  1 git status -ss
  1 git status
  1 git satus -s
  1 git rm --chached
  1 git reset --soft
  1 git reset --hard
  1 git reflog
  1 git rebase --skip
  1 git rebase --continue
  1 git push --set
  1 git log
  1 git diff --cached
  1 git branch --remote
  1 git branch -d
  1 git barnch
  1 git add -u
  1 git add --all

@hugosenari
Copy link

This stats may be wrong, I'm sure that 'status' has more use than 'remote', but in average is true ;)

206 git cbissue (alias: commit -m ...)
 88 git commit -m
 80 git add
 49 git bissue (alias: checkout -b ...)
 39 git diff --word-diff
 29 git checkout
 28 git remote
 10 git status -s

@fcoury
Copy link

fcoury commented Feb 17, 2014

I am getting an error:

$ history | grep -o "^git [a-Z]*\( -\{1,2\}\([a-Z]\)*\)*"
grep: Invalid range end
$ grep --version
grep (GNU grep) 2.16
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

@romankierzkowski
Copy link

On Mac:
history -w /dev/stdout | grep -o -e "^git [a-zA-Z0-9]( -{1,2}([a-zA-Z0-9]))*" | sort | uniq -c | sort -rg

@toupeira
Copy link

Looks like my aliases are paying off:

    736 git st      (status)
    183 git sw      (checkout)
    110 git ca      (commit -va)
    102 git g       (!f() { if [ \"`uname -s`\" = 'Darwin' ]; then (gitx $@ &>/dev/null &); elif [ -n \"$DISPLAY\" ]; then (gitg $@ &>/dev/null &); else tig $@; fi; }; f)
     79 git di      (diff --word-diff)
     78 git pu      (-c push.default=simple   push -v --progress
     68 git pua     (-c push.default=matching push -v --progress)
     57 git ci      (commit -v)
     51 git stp     (stash pop)
     50 git up      (pull -v --progress)
     49 git ldiff   (log -p --word-diff)
     44 git pub     (!f() { local target=$1; shift; git push . HEAD:$target $@; }; f)
     41 git merge
     39 git sts     (stash save)
     36 git all     (add -A)
     32 git rm
     28 git help
     24 git co      (checkout)
     23 git rup     (remote update)
     21 git amend   (commit -v --amend)
     19 git wtf     (see http://git-wt-commit.rubyforge.org/)
     18 git ls      (branch -av)
     17 git l       (log --all --graph --pretty=format:\"%C(yellow)[%h]%Creset %C(cyan)%an:%Creset %C(white)%s%Creset%C(green)%d%Creset %C(black bold)%ar%Creset\")
     17 git ff      (merge --ff-only HEAD@{u})
     14 git push
     14 git branch -d
     13 git branch -rd
     12 git tag
     11 git mergetool
     10 git rm -r
     10 git reset --hard
      8 git show
      8 git mv
      8 git ldiff --
      5 git revert
      5 git reset -h
      5 git r
      5 git clean -f -d
      5 git clean -f
      5 git checkout --force
      4 git sw -b
      4 git poof
      3 git unstage
      3 git pu -u
      2 git s
      2 git r -v
      2 git remote
      2 git merge --abort
      2 git diff
      2 git cherry
      2 git add -p
      1 git wt
      1 git t
      1 git stl
      1 git stage                                                                                                      
      1 git rm -rf                                                                                                     
      1 git rev                                                                                                        
      1 git clone                                                                                                      
      1 git checkout -h                                                                                                
      1 git checkout -f                                                                                                
      1 git checkout                                                                                                   
      1 git ca --no                                                                                                    
      1 git add

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment