git存储问题 [英] git stash questions

查看:104
本文介绍了git存储问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行msysgit 1.7.3.1。如果我运行隐藏应用程序,并且存在冲突,则
所有隐藏更改都会进行。这是正确的行为?我发现它
有点令人惊讶。另一个问题:如果我已经隐藏了10个文件,并且其中一个
有冲突,将在存在冲突时隐藏应用,或者应用所有
非冲突文件。

最后,如果我执行以下操作:

  git stash 
git pull
git stash apply

和另一个开发人员已经删除了我已经隐藏的文件,然后我无法
将存储应用于此文件。我怎样才能从存储中检索我的更改?



谢谢!

解决方案

<索引用于表示这些文件没有冲突。您的冲突文件不应该位于索引中。



是10个文件。 Stash会将剩下的9个添加到索引中。修复剩余文件中的冲突。将其添加到索引。然后提交。



重新存储缺少的更改。您可以通过执行git checkout(stash-SHA1或其他对其的引用>)来获取文件 - filespecification



您也可以将您的存储更改为您的分支,然后可以结帐,并做更多的事情。



希望这可以帮助


I am running msysgit 1.7.3.1. If I run stash apply, and there is a conflict, all of my stash changes get staged. Is this the correct behaviour? I found it a little surprising.

Another question: if I have stashed 10 files, and there is a conflict in one of them, will stash apply abort when it has a conflict, or will it apply all non-conflicted files.

Finally, if I do the following:

git stash
git pull
git stash apply

and another developer has removed a file that I have stashed, then I am unable to apply the stash on this file. How can I retrieve my changes from the stash?

Thanks!

解决方案

the index is used to indicate that these files did not have conflicts. Your conflicted files should not be in the index.

re the 10 files. Stash will add the remaining 9 to the index. Fix the conflict in the remaining file. Add it to the index. Then commit.

re the changes from the stash that are missing. You can get your file by doing a git checkout (stash-SHA1 or other reference to it>) -- filespecification

you can also change your stash to a branch which you then can checkout and do more things with.

hope this helps

这篇关于git存储问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆