Last active
January 20, 2022 00:52
-
-
Save padawanR0k/9841468f4f34fc0cd6992c22d6e1faa6 to your computer and use it in GitHub Desktop.
git message tempalate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# new: [TICKET-1111] 안내서 다운로드 기능 추가 | |
# ^--^ ^--------------------------------^ | |
# | | | |
# | +-> 커밋 메시지 (주로 JIRA의 티켓 번호) | |
# | | |
# +-------> 커밋 타입: new, up, fix, style, ref, conv, test, docs, build, chore | |
# [기본 구조] | |
# |------------------- | |
# | 유형: 제목 | |
# | | |
# | 본문 | |
# |------------------- | |
# [제목작성시 유의할 점] | |
# 1. 제목 줄은 50자 이내로 작성한다. | |
# 2. 제목은 개조식 구문으로 작성한다. | |
# 3. 제목 줄은 `유형: 제목`의 형식으로 작성한다. | |
# 4. 제목 끝에 마침표는 생략한다. | |
# 5. 커밋 메시지 유형은 다음 중 하나를 사용한다. | |
# - new: 신규 기능 추가 (코드 수정 발생) | |
# - up(update): 변경, 삭제 (코드 수정 발생) | |
# - fix: 버그 수정 (코드 수정 발생) | |
# - style: css 와 같은 사소한 스타일 수정 (코드 수정 발생) | |
# - ref(refactoring): 코드 리팩토링 (코드 수정 발생, 하지만 동작에 영향을 주지 않음) | |
# - conv(convention): 코드 형식, 정렬 등의 수정 (코드 수정 발생, 하지만 동작에 영향을 주지 않음) | |
# - test: 테스트 코드 추가, 변경, 삭제 (코드 수정 없음) | |
# - docs: 문서 추가, 변경, 삭제 (코드 수정 없음) | |
# - build: 빌드 스크립트 수정, 패키지 배포 설정 변경 등 (코드 수정 없음) | |
# - chore: 위에 해당되지 않는 모든 변경 (코드 수정 없음) | |
# [본문작성시 유의할 점] | |
# 1. 본문은 한 줄 당 72자 내로 작성한다. (Git은 자동 줄바꿈을 해주지 않으므로, 직접 줄바꿈을 해야 한다) | |
# 2. 본문 내용은 어떻게(how) 변경했는지 보다 무엇을(what) 변경했는지 또는 왜(why) 변경했는지를 설명한다. | |
# 3. 본문 내용은 최대한 상세하게 작성한다. | |
# 4. 제목으로 충분한 커밋은 본문을 생략한다. | |
# [예시] | |
# |---------------------------------------- | |
# | new: [TICKET-1111] 안내서 다운로드 기능 추가 | |
# | | |
# | 안내서 다운로드 버튼을 대시보드에 추가한다. | |
# |---------------------------------------- | |
# | |
# 여기서는 개조식이 아닌 간결체를 사용한다. 즉, 문장의 끝이 있고 마침표로 종결한다. | |
# 필요하다면 더 자세한 설명을 추가한다. 한 줄은 72자 정도에서 줄바꿈한다. | |
# | |
# 이 커밋이 해결한 문제에 대해 설명한다. 어떻게 해결했는지보다 왜 이런 변화를 만들었는가에 집중한다. | |
# ("어떻게"는 코드가 설명한다.) 이 변경으로 인해 나타나는 부작용이나 직관적이지 않은 결과가 나타나는가? | |
# 이 내용을 여기에서 설명한다. | |
# | |
# 문단을 더 추가하고자 한다면 문단 사이에 빈 줄을 넣는다. | |
# | |
# - 개조식 서술도 괜찮음 | |
# - 불릿(bullet)으로 하이픈(-)이나 별표(*)를 사용하고, 한 칸의 공간을 띄고 시작하며, | |
# 각 항목 사이 빈 행을 넣는 방식이 일반적이며 다양한 관례가 있음 | |
# 각 항목 사이 빈 행을 넣는 방식이 일반적이며 다양한 관례가 있음 | |
# - 하위 항목 |
git alias
[alias]
s = status -s
co = checkout
ci = commit
br = branch
l = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
b0 = "!git branch | awk '/^\\*/{print $2}'"
back = "!git branch backup-`git b0`"
pll = "!git pull origin `git b0`"
ch = "!git checkout $(git bselect)"
bselect = "! # select branch with preview; \n\
f() { \
_height=$(stty size | awk '{print $1}');\
git branch | egrep -v '^\\*' | fzf --preview \"git l {1} | head -n $_height\"; \
}; f"
s = status -s
a = "!git add $(git status -s | fzf -m | awk '{print $2}')"
alias = "!git config --list | egrep '^alias.+'"
fp = push -u -f origin HEAD
bb = "! # Branch tools. Type 'git bb help' ; \n\
f() { \n\
if [ $# = 0 ]; then \
git checkout $(git branch -vv | grep -v '^\\*' | fzf | awk '{print $1}'); \
elif [ $1 = 'help' ]; then \
echo 'git bb : Select and checkout branch'; \
echo 'git bb c, clean : Clean all merged branches'; \
echo 'git bb d, D : Delete seleted branches(D: force)'; \
echo 'git bb l, list : List branches excluding the current branch'; \
echo 'git bb m, merged : List merged branches excluding the current and master branches'; \
elif [ $1 = 'd' -o $1 = 'D' ]; then \
git branch -$1 $(git bb list | fzf -m); \
elif [ $1 = 'clean' -o $1 = 'c' ]; then \
git branch -d $(git bb merged); \
elif [ $1 = 'list' -o $1 = 'l' ]; then \
git branch | grep -v '^\\*'; \
elif [ $1 = 'merged' -o $1 = 'm' ]; then \
git branch --merged | grep -v '^\\*\\|\\<master$'; \
else \
git bb help; \
fi; \
}; f"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
템플릿 생성
템플릿 사용하기 설정
git config --global commit.template ~/.gitmessage.txt