개발/기타

git add commit push 한 번에 하기

MiJey 2020. 4. 23. 18:03

git bash에서 git cmp라는 커맨드를 추가하는 방법이다.

 

git config --global alias.cmp '!f() { git add --all && git commit -m "`date`" && git push; }; f'

 

커밋 메시지에 `date` 라고 적으면 현재 시간이 찍힌다(ex. 2020년 04월 23일 목 오후  5:58:52).

이제 git cmp 라고 입력하면 add, commit, push가 한꺼번에 된다.

 

개인적으로 메모장 용도로 쓰고 있는 레포에서 유용하게 쓰고 있다.

 

참고 사이트: https://stackoverflow.com/questions/19595067/git-add-commit-and-push-commands-in-one