2011-11-30 129 views
0

我在删除交换文件之前调用了git stash,然后再发出拉取请求。当我试图git stash pop,我得到了以下错误当交换文件被删除时,git存储弹出失败

不能适用于肮脏的工作树,请阶段更改

我跟着这个wiki,并试图通过打补丁的修改申请。但它不起作用。

我想这消息会给出一些提示

diff --git a/db/.schema.rb.swp b/db/.schema.rb.swp 
deleted file mode 100644 
index 6570b8e..0000000 
Binary files a/db/.schema.rb.swp and /dev/null differ 

如何解决这个问题?

回答

0

不应该交换文件到git仓库。尝试按照说明操作:

git rm db/.schema.rb.swp # Delete the swap file from git repository 
echo "*.swp" >> .gitignore # Ignore swap files 
git add .gitignore 
git commit     # Commit the deletion & changes 
git status     # Make sure that you have no uncommited changes 
git stash apply   # Then apply the stash 
相关问题