git 如何在 Github Desktop 中运行 stash?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44014775/
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
How to run stash in Github Desktop?
提问by fatherazrael
How do you run stash in GitHub Desktop on Windows?
如何在 Windows 上的 GitHub Desktop 中运行 stash?
The feature is available in Sourcetree but I'm unable to find it in GitHub Desktop.
该功能在 Sourcetree 中可用,但我无法在 GitHub Desktop 中找到它。
回答by Andrew
GitHub Desktop for Windows doesn't support stash. The only stash-like feature it has is that it will allow you to switch branches if you have uncommited changes. Source
GitHub Desktop for Windows 不支持存储。它唯一的类似 stash 的功能是,如果您有未提交的更改,它将允许您切换分支。来源
Update:GitHub Desktop V2.0.0 now supports stash (Issue 6107).Now when switching branches, you'll be prompted to either leave your changes on the current branch (stash) or bring your changes over to the other branch.
更新:GitHub Desktop V2.0.0 现在支持 stash (问题 6107)。现在,在切换分支时,系统会提示您将更改保留在当前分支(stash)上,或者将更改转移到另一个分支。
回答by Firestar9114
I realize this question is a bit old, and Andrew is correct, but I would like to point out that GitHub Desktop does at least provide a shortcut to a command prompt via Repository>Open in Command Prompt
which you can then use to execute git stash
through the traditional git CLI commands. Still, frustrating that GitHub Desktop doesn't provide a clean way to do this via their GUI, forcing you to fallback to git CLI tools for stashing.
我意识到这个问题有点老了,Andrew 是正确的,但我想指出 GitHub Desktop 至少提供了命令提示符的快捷方式,Repository>Open in Command Prompt
然后您可以通过它来执行git stash
传统的 git CLI 命令。尽管如此,令人沮丧的是 GitHub Desktop 没有通过他们的 GUI 提供一种干净的方法来做到这一点,迫使你回退到 git CLI 工具来进行存储。
UPDATE!: Github Desktop apparently updated and can now stash by switching to another branch with uncommitted changes. You will automatically be asked if you want to leave your changes on the current branch(stash) or bring them to the other branch:
更新!:Github 桌面显然已更新,现在可以通过切换到具有未提交更改的另一个分支来存储。系统会自动询问您是要将更改保留在当前分支(stash)上还是将它们带到另一个分支:
Then when going back to the branch later, the you can restore from the stash, or discard them:
回答by yogesh_desai
回答by Dasser Basyouni
For those who are using Android Studio, no need for Github Desktop version in switching between branches, just switch from the Android Studio itself
对于使用 Android Studio 的用户,在分支之间切换不需要 Github Desktop 版本,只需从 Android Studio 本身切换即可
select the branch you want to switch to > Rebase onto
选择要切换到的分支 > Rebase on
PS: The Android Studio notify you with
Rebase failed
error (if you have created files in the branch you are on) and you will have to remove them by clicking onView themRetry
then select them all and delete with the red-
sign button, then do a Rebase onto again.
PS:Android Studio 会通知您
Rebase failed
错误(如果您在所在的分支中创建了文件),您必须通过单击将其删除,View themRetry
然后选择全部并使用红色-
标志按钮删除,然后再次执行 Rebase .