4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

[git] git pull 에러 발생시 ( error: Your local changes to the following files would be overwritten by merge )

간혹 여러 소스를 관리하다보면 아래와 같이 git pull 을 사용할때 에러가 발생할 수 있습니다.

$ git pull origin master
error: Your local changes to the following files would be overwritten by merge:
course/course.php
course/modals/post/postListModal.php
course/modals/selectPostTypeModal.php
Please commit your changes or stash them before you can merge.
Aborting

이때 간단한 처리 방법은 git stash 을 통하여 처리가 가능합니다.

$git stash

$Saved working directory and index state WIP on master: 946dedf fix quotes problem
$HEAD is now at 946dedf fix quotes problem

일단 에러의 원인은 pull 로 가져오려는 소스와 현재 저장된 코드와 재대로 처리가 되지 않아서 나는 에러 입니다.
이때 stash 는 현재 디렉토리의 파일을 임시로 백업하고 깨끗한 상태로 돌립니다.

이제 다시 git pull origin master 를 할 경우 정상적으로 업데이트 되는 것을 확인 하실 수 있습니다.

4 upvotes $0.05

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: