2016-12-22 15 views
7

は私が引くと、 "スワップファイルを.MERGE_MSG.swpはすでに存在している":私はプッシュしはgitのマージエラー解決方法

E325: ATTENTION 
Found a swap file by the name "~/Documents/Sites/recipegenerator/.git/.MERGE_MSG.swp" 
      owned by: username dated: Wed Dec 14 12:28:45 2016 
     file name: ~username/Documents/Sites/recipegenerator/.git/MERGE_MSG 
      modified: YES 
     user name: username host name: Users-MacBook-Pro.local 
     process ID: 33747 
While opening file "/Users/larsvanurk/Documents/Sites/recipegenerator/.git/MERGE_MSG" 
      dated: Thu Dec 22 14:06:17 2016 
     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 /Users/username/Documents/Sites/recipegenerator/.git/MERGE_MSG" 
    to recover the changes (see ":help recovery"). 
    If you did this already, delete the swap file "/Users/username/Documents/Sites/recipegenerator/.git/.MERGE_MSG.swp" 
    to avoid this message. 

Swap file "~/Documents/Sites/recipegenerator/.git/.MERGE_MSG.swp" already exists! 

To https://github.com/nickname/recipegenerator.git 
! [rejected]  master -> master (fetch first) 
error: failed to push some refs to 'https://github.com/nickname/recipegenerator.git' 
hint: Updates were rejected because the remote contains work that you do 
hint: not have locally. This is usually caused by another repository pushing 
hint: to the same ref. You may want to first integrate the remote changes 
hint: (e.g., 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

助けてください:C IDK何をしますか。押したり引いたりすることはできません。私は思っていたことをすべて試しました。私も試した:git merge --abort。事は私がそれをするとき、私は解決すべき私の葛藤を見つけることができないようです。

答えて

9

明らかにgitのテキストエディタとして使用しているVIMからのメッセージです。あなたはこれらの2つのポイント(1)(2)を読んで試してみましたか?そのうちの1つはおそらく真実で、この問題を解決できるようになります。

まず、MERGE_MSGファイル(MERGE_MSG.swpではありません)をチェックし、ファイルが存在し、その中に入っているかどうかを確認してください。おそらく、ゴミ箱または安全に削除できる一時ファイルです。名前から判断すると、おそらく、マージコミットメッセージの一時的なテキスト編集領域として使用されるファイル名です。

VIMを使用するため、VIMが起動すると、内部的なニーズに合わせてスワップファイルを作成しようとします。エラーメッセージには、~/Documents/Sites/recipegenerator/.git/.MERGE_MSG.swpと表示されます。このようなスワップファイルは、古いファイルや予期しないファイルを削除するだけで簡単に削除することができます。しかし、最近いくつかのマージコミットメッセージ編集セッションがクラッシュした場合、失われたくない創造的なテキストがあった場合は、削除しないでください。がスワップする代わりに、 2)を入力します。

しかし、何が起こっているのか分からず、あなたが書いたテキストを失うことについて何も言わなかったので、とにかく自動生成されたMERGE_MSGなので、あなたはできると思います:

git merge --abort 
rm ~/Documents/Sites/recipegenerator/.git/.MERGE_MSG.swp 

しばらくお待ちください。

また、(1)で説明したヒントをエラーメッセージで確認するとよいでしょう。 psか、現在そのMERGE_MSGを編集している可能性のある開いているVIMセッションがあるかどうかを確認してください。あなたが何かを見つけたら、それらに行き、編集を終了するか、終了する(エスケープする:q!、enter)(vimは終了時にクリーンアップのスワップを行う)、それらを終了する(killする。スワップファイルを手動で削除します)。

関連する問題