Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git 사용 방법
  6. Mac에서 Git을 사용하는 방법
  7. 충돌 만들기
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

충돌 만들기

충돌이 발생하면 이를 해결하여 작업을 완료해야 합니다. 이 단계에서는 “tutorial” 및 “tutorial2 두 개의 기존 저장소를 사용하여 의도적으로 충돌을 만들 것입니다.

먼저 컴퓨터의 tutorial 디렉터리에서 sample.txt 파일을 엽니다. 아래의 굵은 텍스트를 파일에 추가하고 커밋합니다.

Anyone can learn Git with this tutorial and Backlog


add: Register a change in an index commit: Save the status of an index

Record the status of commit index

다음으로, tutorial2 디렉터리에서 sample.txt 파일을 엽니다. 아래의 굵은 텍스트를 파일에 추가하고 커밋합니다.

Anyone can learn Git with this tutorial and Backlog


add: Register a change in an index pull: Obtain the content of the remote repository

pull Acquire the contents of a remote repository.

이제 tutorial2의 변경 사항을 원격 저장소로 푸시합니다.

push the change from tutorial2 to the remote repository

현재 원격 저장소에서 sample.txt 파일에는 세 번째 라인인 pull: Obtain the content of the remote repository가 포함되어 있으며 기록 로그에 커밋되었습니다.

다음으로, tutorial 저장소에서 원격 저장소로 커밋을 푸시할 것입니다.

Git raises a conflict and rejects your push

보시다시피 Git은 충돌을 일으키고 푸시를 거부합니다.

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life