Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 2.36 KB

007-zsh-git-aliases.md

File metadata and controls

72 lines (58 loc) · 2.36 KB
title date draft summary description tags author showToc TocOpen hidemeta comments canonicalURL disableHLJS disableShare hideSummary searchHidden ShowReadingTime ShowBreadCrumbs ShowPostNavLinks ShowWordCount ShowRssButtonInSectionTermList UseHugoToc cover editPost
✨ Oh My Zsh Git Aliases
2023-03-17 14:36:08 +1300
false
Supercharge your Git workflow in Oh My Zsh
Supercharge your Git workflow in Oh My Zsh
Git
Magdeline Huang
true
false
false
true
false
false
false
false
true
true
true
true
true
true
image alt caption relative hidden
<image path/url>
<alt text>
<text>
false
true
URL Text appendFilePath
Suggest Changes
true

If you manage your Git workflow via the terminal and your terminal is Oh My Zsh, then you're in for a treat.

Oh My Zsh has a bunch of built-in aliases for Git commands which are an absolute game-changer 🤯

gst = git status # status of your repo and changes

gapa = git add --patch # choose which changes in a file to commit
gaa = git add --all # stage all your changes

gcmsg = git commit -m # commit with a message

gco = git checkout # change to a specific branch
gcb = git checkout -b # create a new branch off the current branch and change to it at the same time

gp = git push # add your changes to the remote repo
gpsup = git push --set-upstream origin $(current_branch) # push a local branch to remote

gl = git pull # obtain the latest changes from the remote repo

gm = git merge # combine various versions of a file or folder

grhh = git reset --hard # undo all your changes

gsta = git stash push # add to your stash
gstp = git stash pop #remove from your stash

See here for the complete list of aliases.

And if you forget what an alias does, just do this which <alias> eg

> which gst
gst: aliased to git status