본문 바로가기
WWWEB/GIT

git 협업

by 미니토이 2020. 9. 21.

##git 협업

 

1. git clone "깃헙주소"

2. git branch "브랜치 이름"

3. git checkout "브랜치 이름"

 

-- 작업 --

 

 

[ push ]

1. git add .

2. git commit -m {작업 내용}

3. git checkout master

4. git merge {브랜치 이름}

 

-- git pull --

 

5. git push origin master

 

 

 

[ push 오류 시 : ! [rejected] master -> master (fetch first) ]

git pull --rebase {원격 저장소 이름} master

 

 

 

[ pull ]

1. git checkout master

2. git pull origin master

3. git checkout {브랜치 이름}

4. git merge master

 

 

 

[ branch 지우기 ]

1. git branch -d {브랜치 이름}

 

 

 

[ revert ]

1. git revert commit번호

 

 

 

##git commit 삭제

 

1. git reset HEAD^ / git reset HEAD~1

2. git push -f origin "브랜치명"

 

 

 

 

[git 에러] Please enter a commit message to explain why this merge is...

 

1. "i" 입력

2. merge에 대한  commit 메세지 입력

3. "esc" 입력

4. ":wq" 입력

5. "enter" 입력

 

간략: https://jennnn.tistory.com/69

상세: https://valuelog.tistory.com/54

 

 

728x90
반응형

'WWWEB > GIT' 카테고리의 다른 글

[git] LF will be replaced by CRLF ... 오류  (0) 2023.01.05

댓글