git “提交您的更改或隐藏它们”是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10959928/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:02:55  来源:igfitidea点击:

What does "commit your changes or stash them" mean?

gitversion-control

提问by Tim Tom

I have my branch on my GIT repository where I used to commit and push. But today I saw a different programmer committed and pushed to my branch. Now when I try to pull the latest branch GIT completes it half way and then gives error "Either commit your changes or stash them". I have no idea what that means and I don't want to commit before taking his latest changes on my branch. How do I solve this issue?

我的 GIT 存储库中有我的分支,我曾经在那里提交和推送。但是今天我看到一个不同的程序员提交并推送到我的分支。现在,当我尝试拉取最新的分支时,GIT 完成了一半,然后给出错误“要么提交您的更改,要么隐藏它们”。我不知道这意味着什么,我不想在他对我的分支进行最新更改之前提交。我该如何解决这个问题?

回答by jalf

It means that you have uncommitted changes, which prevents you from pulling.

这意味着您有未提交的更改,这会阻止您进行拉取。

And you solve it by either committing them or stashingthem. Just like the error message says.

你可以通过提交它们或隐藏它们来解决它。就像错误消息所说的那样。

(By the way, you typically get better answers by asking precise questions. If you want to know what git stashis, ask that. Simply asking "how do I solve the problem where Git tells me to commit or stash" simply leads to answers like "you should commit or stash".

(顺便说一句,您通常会通过提出精确的问题来获得更好的答案。如果您想知道是什么git stash,就问那个。简单地问“我如何解决 Git 告诉我提交或存储的问题”只会导致类似“你应该提交或藏匿”。

Git itself has already answered your question. If you didn't understand thatanswer, ask about the part you don't understand.

Git 本身已经回答了你的问题。如果您不明白答案,请询问您不明白的部分。