ID_DI
DI's study notes
ID_DI
전체 방문자
오늘
어제
  • 분류 전체보기 (85)
    • Deep-Learning (3)
      • CNN (2)
      • NLP (1)
    • Data_Python (6)
      • Numpy (0)
      • Matplotlib (4)
    • Python (8)
      • Python Algorithm (6)
    • Java (36)
      • Java(base) (33)
      • Java practice(base) (2)
    • Git (12)
    • Algorithm (7)
    • etc (7)
    • linux (1)
    • DeskSetup (0)
    • TIL_모각코 (4)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • git
  • java.lang
  • matplotlib
  • binarySearch
  • 자바
  • git add.
  • staged
  • 정렬
  • 커밋
  • 파이썬
  • java
  • Github
  • 알고리즘
  • 합병정렬
  • java.net
  • Python
  • java 기초
  • java base
  • string to int
  • README.md

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
ID_DI

DI's study notes

[Git] 협업 시, git push 오류 해결 {merge conflict}
Git

[Git] 협업 시, git push 오류 해결 {merge conflict}

2022. 2. 12. 17:49

협업시 git push 오류

error: failed to mpush some refs to 'http://github.com/~~~'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usaully caused by another repsitory pushing
    hint: to the same ref. You may want to first integrate the remote changes
    .
    .
    .

협업 시에 리모트 레포지토리에 누군가가 git push 해놓은 상태에서 나의 레포지토리의 수정사항을 git push한다면, 아래와 같이 오류가 난다.

이를 해결하기 위해서 git pull 을 먼저 해주고 git push 를 한면 된다.

만약 merge conflict 가 일어나면 직접 파일로 가서 수정을 해준 뒤, git pull 해주면 해결된다.

git merge 처리가 된다.

이후 git push 해주면 된다.

  1. git pull 을 해준다.
  2. merge conflict 가 났을 때, working tree에서 파일을 직접 수정해준다.
  3. git pull 을 해준다.
  4. git push 을 해준다.

따라서 협업을 할 때, 무작정 git push 를 할 것이 아니라, git pull 을 해준 뒤, merge conflict 를 해결한 뒤, git pull 을 하는 것이 현명하다.


merge conflict 해결법 :

branch와 git merge 해결법 링크

'Git' 카테고리의 다른 글

[Git] origin 이란?  (0) 2022.02.12
[Git] git branch 란  (0) 2022.02.12
[Git] Head 란, git reset {--hard, --soft, --mixed}, git tag  (0) 2022.02.12
[Git] Git 커밋하기 {Commit 메세지 가이드라인}  (0) 2022.02.12
[Git] Git push/pull , clone 와 Commit history 조회하기  (0) 2022.02.12
    'Git' 카테고리의 다른 글
    • [Git] origin 이란?
    • [Git] git branch 란
    • [Git] Head 란, git reset {--hard, --soft, --mixed}, git tag
    • [Git] Git 커밋하기 {Commit 메세지 가이드라인}
    ID_DI
    ID_DI
    Computer Vision

    티스토리툴바