development

pull 명령을 사용할 때 github가 mac 터미널을 잠급니다.

big-blog 2020. 9. 2. 20:07
반응형

pull 명령을 사용할 때 github가 mac 터미널을 잠급니다.


나는 Mac (명령 줄)에서 github를 배우는 과정에 있으며 할 때마다 이것을 git pull origin master얻습니다.

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
".git/MERGE_MSG" 7L, 293C

터미널이 잠긴 것처럼 보이며 즉시 아무것도 입력 할 수 없습니다. 마침내 텍스트를 입력 할 수있게되었을 때 git 명령을 인식하지 못하는 것 같습니다.

이것은 git의 버그입니까, 아니면 뭔가 빠졌습니까?


당신은 텍스트 편집기에 있습니다, vim! 그것은이다 모달 당신이 필요하므로, 텍스트 편집기 :

  1. 을 눌러 삽입 모드i 로 들어 갑니다 .
  2. 이제 일반 (모달이 아닌) 텍스트 편집기에있는 것처럼 메시지를 입력 할 수 있습니다.
  3. 명령 모드esc 로 돌아가려면 누릅니다 .
  4. 입력 한 다음 :w다음 enter저장합니다.
  5. 마지막으로 :q다음 enter종료합니다.

간단하게.

유형 :wqenter


설명에 따르면 편집기는 vim 처럼 보입니다 . 이 콘솔은 단순히 만들고 싶은 커밋에 대한 메시지를 작성하라고 말하고 있으며, 그렇게하는 것은 필수입니다.

  • 그냥 입력 i하고 당신은 갈거야 -- INTER --지금 당신은 귀하의 의견을 쓸 수 있습니다 모드.

  • 쓰기를 마친 후 esc키보드에서 키를 누르면 명령 모드로 이동합니다. ( 콘솔 하단 참조 )

  • 이제 쓰기 :wenter를 눌러 변경 사항을 저장하십시오.

<code> : w </ code> 명령 작성

  • 글을 쓰고 :q를 눌러 지금 종료 할 수 있습니다.enter

<code> : q </ code> 명령 작성

  • 만세! 마지막으로 메인 콘솔로 돌아 왔습니다.

이 명령 실행

git config --global core.editor "gedit"

Add your message in this file and save it. Go back pull now.


I fixed this problem by executing following steps

  1. Remove #MERGE_MSG#

    rm .git/\#MERGE_MSG#

  2. Remove MERGE_HEAD

    rm .git/MERGE_HEAD

Additionally, I explicitly set git's editor to an editor that I am familiar with vim (you can set nano)

`git config --global core.editor "vim"`

You can do git checkout --merge yourbranch

A three-way merge between the current branch, your working tree contents, and the new branch is done, and you will be on the new branch.


Problems usually happen when we misspell something.
It is more likely this command you are interested in:

git commit -m "message"

if there was a problem, it might say something like

Your branch and 'origin/master' have diverged,
and have 2 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

and use:

git pull

which should lead to:

Already up-to-date.

Then it is good to check:

git status

and try pushing again:

git push

More simple is first ESC and then : x (lowercase).

참고 URL : https://stackoverflow.com/questions/14046122/github-locks-up-mac-terminal-when-using-pull-command

반응형