混帐存储和混帐拉 [英] git stash and git pull
问题描述
我修改了几个文件,然后隐藏了更改,然后执行了 git pull
在命令行中拉出所有最新的提交。然后我从EGit中完成了 Apply ststhed changes
。现在它应用了我的更改,并且从上次提交的存储文件中提取的更改都已经结束。我不确定为什么它没有询问我有关合并冲突,并覆盖了我的更改并丢失了以前的提交更改。
如何获取这些更改?
在你的工作拷贝上,从命令行执行:
git stash
这会储存您的更改并清除您的状态报告
git拉
这会从上游分支拉出更改。确保它在报告中说明快进。如果没有,你可能正在做一个意外的合并
git stash pop
这会将隐藏的更改应用到工作副本,并从隐藏中删除更改,除非有冲突。如果发生冲突,他们将留在隐藏处,以便在需要时重新开始。
如果您需要查看隐藏内容
git储存列表
I am new to Git and I am using EGit eclipse plugin to commit.
I modified few files and I stashed the changes, then I did git pull
in command line which pulled up all the latest commits. Then I did Apply stashed changes
from EGit. Now it applied my changes and the changes which pulled from last commit of stashed files went out. I am not sure why it didn't ask me about merge conflicts and overwrote my changes and lost previous commits changes.
How to get those changes?
When you have changes on your working copy, from command line do:
git stash
This will stash your changes and clear your status report
git pull
This will pull changes from upstream branch. Make sure it says fast-forward in the report. If it doesn't, you are probably doing an unintended merge
git stash pop
This will apply stashed changes back to working copy and remove the changes from stash unless you have conflicts. In the case of conflict, they will stay in stash so you can start over if needed.
if you need to see what is in your stash
git stash list
这篇关于混帐存储和混帐拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!