깃 허브사용 정리
깃 허브에서 다운받기
git init
(1)git checkout -b dw.choi
(2)git remote add origin 깃주소복사
(3)git pull origin develop
(4-스테이지에올리기?)git add . (엔터)
(5)git commit -m '커밋내용'
(6)git push -u origin dw.choi
(7)git checkout develop
(8)merge / push
git checkout dw.choi
war로 배포하기
./gradlew war
기본적인 흐름
add -> commit -> push -> checkout(마스터로가서) -> merge -> push -> checkout (혹시모르니 꼭 다시 내 브랜치로 돌아오자)
========내용설명
add를 취소 :git rm[파일명]
로그인하기
git config --global user.email dw.choi@theuber.co.kr
git config --global user.name dw.choi
마지막으로 commit된 내역 보기 : git log
위에 치면 다른명령어 칠 수 없음 빠져 나올 땐 : q
원격 저장소를 관리하는 명령어 : git remote
origin 이라는 이름으로 등록 : git remote add origin 주소
원격저장소 삭제 : git remote remove origin
pull할 때마다 비밀번호치기 귀찮 : git config --global credential.helper 'store --file 경로
아무것도 없을 때 프로젝트 내려받기(자동 init까지됨) : git clone [저장소 주소]
상태 확인 : git status
수정된 파일에서 달라진 점 확인하기 : git diff
원래대로 되돌리기(add하지 않고 unmodified로) : git checkout git.html
되돌리기2(add후 staged 상태 시) git reset git.html(이러면 Modified상태) -> checkout git.html
브랜치 만들기 : git branch [브랜치이름]
만들어진 브랜치 확인하기 : git branch
브랜치전환(head옮기기)하기 : git checkout[브랜치이름]
master브랜치에 모으기위해 master로 돌아가기 : git checkout master
master와 합치기 : git merge [브랜치명] (합칠 branch임!!)
merge전에 항상 git branch명령어로 현재 head가 바탕이되는 master에 있나 확인하기!!
branch두개 합치기 : git rebase
출처 : https://www.zerocho.com/category/Git