Tool-Setting
cmd 이용해서 git add/commit/push하기
인기쟁이 돌고래
2021. 2. 2. 04:17
보통 sourceTree를 사용하긴 하지만 유사시(?!) cmd로 해야하는 경우가 있을 수 있다.
예를들어 소스트리 귀찮아서 IDE에 있는거로 대충 쓸려다가 안된다거나..안된다거나...안된다거나..
IDE에 있는 터미널이나 그냥 터미널이나 아무거나 켜서 작업중인 프로젝트로 이동한다.
수정사항 확인
> git status
변경내용 staging영역으로 이동 (git add)
// tracked file 모두를 add
> git add *
// 특정 파일만 add 시키기
> git add {올릴 파일명}
(예) git add src/main/resources/application-default.properties
잘못 add한 내용 내리기 (git reset)
> git reset HEAD {내릴 파일명}
(예) git reset HEAD src/main/resources/application-default.properties
commit 메시지 넣어서 커밋하기 (git commit)
> git commit -m '{커밋메시지}'
(예) git commit -m '[#14]DB설정h2로 변경'
Origin branch로 올리기 (git push)
> git push
Origin 확인