DEV Community


Posted on • Updated on

Do you know Oh-My-Zsh Prepares Git Aliases for you?

I just knew ↓ lol.

g:       $git   
gst:     $git status
gl:      $git pull  
gup:     $git fetch && git rebase
gp:      $git push  
gc:      $git commit -v
gca:     $git commit -v -a  
gco:     $git checkout
gcm:     $git checkout master   
gb:      $git branch
gba:     $git branch -a 
gcount:  $git shortlog -sn
gcp:     $git cherry-pick   
glg:     $git log --stat --max-count=5
glgg:    $git log --graph --max-count=5 
gss:     $git status -s
ga:      $git add   
gm:      $git merge
grh:     $git reset HEAD    
grhh:    $git reset HEAD --hard
gsr:     $git svn rebase    
gsd:     $git svn dcommit
ggpull:  $git pull origin $(current_branch)
ggpush:  $git push origin $(current_branch)
gdv:     $git diff -w "$@" | view -
ggpnp:   $git pull origin $(current_branch) && git push origin $(current_branch)
git-svn-dcommit-push: $git svn dcommit && git push github master:svntrunkgpa: $git add .; git commit -m "$1"; git push;
Enter fullscreen mode Exit fullscreen mode
$ gst
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Enter fullscreen mode Exit fullscreen mode
$ glg

## result ##
git:master o [15:47:02] C:130
commit cf161dc226269e1ad93318cbd4bfc366da259cf0 (HEAD -> master, origin/master, origin/HEAD, test_test)
Author: koji <>
Date:   Tue Apr 27 19:16:15 2021 -0400


 src/components/appbar.tsx | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

commit 241bafd99cdff1f193a1c6f932ee34b205f46d95
Merge: deffda8 ffbfe69
Author: Koji <>
Date:   Thu Apr 22 02:40:02 2021 -0400

    Merge pull request #134 from koji/migration_from_v2_to_v3

commit ffbfe6927bb8babe17a98e44826a3ec5a6a10d13 (origin/migration_from_v2_to_v3)
Author: koji <>
Date:   Thu Apr 22 02:35:16 2021 -0400

    add .nvmrc for v3

 .nvmrc | 1 +
 1 file changed, 1 insertion(+) 
Enter fullscreen mode Exit fullscreen mode

I highly recommend you to check this out!

Oldest comments (0)