Blog

Git Alias

alias

git alias ๊ธฐ๋Šฅ์„ ํ†ตํ•ด ์ถ•์•ฝ์–ด ํ˜•ํƒœ๋กœ git command ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค

์„ค์ •

$ git config --global alias.co checkout $ git config --global alias.br branch $ git config --global alias.ci commit $ git config --global alias.st status
Shell
๋ณต์‚ฌ

์‚ฌ์šฉ

$ git co BRANCH Switched to branch 'BRANCH' $ git br * master
Shell
๋ณต์‚ฌ

๊ธฐํƒ€

โ€ข
์ง์ ‘ gitconfig ํŒŒ์ผ์„ ์ˆ˜์ •ํ•ด์„œ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค
โ€ข
๋‚ด๊ฐ€ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” alias ๋“ค์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค
$ vim ~/.gitconfig [alias] co = checkout br = branch ci = commit st = status unstage = reset HEAD -- last = log -1 HEAD -p hide = update-index --assume-unchanged unhide = update-index --no-assume-unchanged $ git unstage FILE_NAME $ git last
Bash
๋ณต์‚ฌ

์ฐธ๊ณ 

โ€ข
https://git-scm.com/book/ko/v2/Git%EC%9D%98-%EA%B8%B0%EC%B4%88-Git-Alias