JaeYeopHan / tip-archive

📦 Archiving various development tips. If you watch this repository, you can get issues related to the newly registered development tip from the GitHub feed.
https://www.facebook.com/Jbee.dev/
245 stars 8 forks source link

oh my zsh git plugin 소개 및 command 정리 #9

Open JaeYeopHan opened 6 years ago

JaeYeopHan commented 6 years ago

Setup

  1. Install iTerm2
  2. brew install

oh-my-zsh Git plugin

$ vi ~/.zshrc
plugins=(git)
$ source ~/.zshrc

Alias Description

Base

Alias Command
gsb git status -sb
gst git status
ga git add
gaa git add --all
gc git commit -v
gba git branch -a
gc! git commit -v --amend
gcb git checkout -b
gcm git checkout master
gcmsg git commit -m
gco git checkout
gd git diff
gl git pull
glg git log --stat --color
gm git merge
gp git push

fetch & rebase

Alias Command
gf git fetch
gfo git fetch origin
grb git rebase
grba git rebase --abort
grbc git rebase --continue
grbi git rebase -i

Additional

Alias Command
ggf git push --force origin $(current_branch)
grt cd $(git rev-parse --show-toplevel || echo ".")
gunignore git update-index --no-assume-unchanged
gignore git update-index --assume-unchanged

Customzied

Alias Command
gfupdate gaa && g cmov && ggf
gre git reset HEAD^
gconn git remote add --track master upstream
gov g cmov
gr git checkout -- .

Setup

vi ~/.zshrc
alias gfupdate="gaa && g cmov && ggf"
alias gre="git reset HEAD^"
alias gconn="git remote add --track master upstream"
alias gov="g cmov"
alias gr="git checkout -- ."
alias gpom="git push origin master"
source ~/.zshrc