IT TIP

이름으로 스왑 파일을 찾았습니다.

itqueen 2020. 12. 1. 20:19
반응형

이름으로 스왑 파일을 찾았습니다.


내 분기를 원격 분기와 병합하려고 할 때 :

git merge feature/remote_branch

이 메시지를 받았습니다.

E325: ATTENTION
Found a swap file by the name ".git/.MERGE_MSG.swp"
          owned by: xxxxxx   dated: Mon Nov 12 23:17:40 2012
         file name: ~xxxxxx/Desktop/My-ios-App/.git/MERGE_MSG
          modified: YES
         user name: xxxxxx   host name: unknown-b8-8d-12-22-27-72.lan
        process ID: 1639
While opening file ".git/MERGE_MSG"
             dated: Tue Nov 13 14:06:48 2012
      NEWER than swap file!

(1) Another program may be editing the same file.
    If this is the case, be careful not to end up with two
    different instances of the same file when making changes.
    Quit, or continue with caution.

(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r .git/MERGE_MSG"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".git/.MERGE_MSG.swp"
    to avoid this message.

Swap file ".git/.MERGE_MSG.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

어떻게 처리할까요?


열려 git commit있거나 git merge진행 중이며 커밋 메시지를 편집하는 편집기가 아직 열려있는 것 같습니다.

두 가지 선택 :

  1. 세션을 찾아 끝내십시오 (권장).
  2. .swp파일을 삭제 합니다 (다른 git 세션이 사라진 것이 확실한 경우).

의견에 대한 설명 :

  • 세션은 편집 세션입니다.
  • 편집 세션 내 .swp에서 명령을 입력하여 사용중인 내용을 볼 수 :sw있지만 일반적으로 .swp파일 접미사 (예 :) ~/myfile.txt가있는 사용중인 파일과 동일한 디렉토리에있는 숨겨진 파일입니다 ~/.myfile.txt.swp.

수락 된 대답은 .swp 파일을 삭제하는 방법을 언급하지 않습니다.

프롬프트가 나타나면 "D"를 누르면 제거됩니다.

제 경우에는 D를 누른 후 최신 저장된 버전을 그대로두고 VIM을 잘못 종료했기 때문에 생성 .swp삭제했습니다.


또한 가져 오려는 업스트림 분기에서 생성되지 않은 분기로 변경 사항을 가져 오려고 할 때이 오류가 발생했습니다.

예-이것은 night-version업스트림과 일치하는 새 분기를 만듭니다.

git checkout upstream/night-version -b testnightversion

이것은 업스트림 testmastermaster분기 와 일치하는 로컬 분기 만듭니다 .

git checkout upstream/master -b testmaster 

이제 변경 사항 night-versiontestmaster분기로 가져 오려고 하면이 오류가 발생합니다.

git pull upstream night-version //while I'm in `master` cloned branch

적절한 분기로 이동하여 변경 사항을 가져 와서이 문제를 해결했습니다.

git checkout testnightversion
git pull upstream night-version // works fine.

.MERGE_MSG.swp is open in your git, you just need to delete this .swp file. In my case I used following command and it worked fine.

rm .MERGE_MSG.swp

참고URL : https://stackoverflow.com/questions/13361729/found-a-swap-file-by-the-name

반응형