按名称find交换文件
当我尝试合并我的分支与远程分支:
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
继续,编辑器仍然是开放的编辑提交消息。
两个select:
- find会议并完成它(最好)。
- 删除
.swp
文件(如果你确定其他的git会话已经消失)。
我也试图把变化拉到一个分支,而不是从我试图从上游分支创build的这个错误。
例如 – 这会创build一个与上游night-version
匹配的新分支
git checkout upstream/night-version -b testnightversion
这将在本地创build一个与上游master
分支匹配的分支testmaster
。
git checkout upstream/master -b testmaster
现在,如果我试图把night-version
的变化拖入testmaster
分支导致这个错误。
git pull upstream night-version //while I'm in `master` cloned branch
我设法解决这个问题,通过导航到适当的分支,并拉动变化。
git checkout testnightversion git pull upstream night-version // works fine.