使用 Git 扩展存储选定的文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22209917/
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
Stash selected files with Git Extensions
提问by Cincinnati Joe
Is there a way with Git Extensions to only stash some of the uncommitted files?
Git 扩展有没有办法只存储一些未提交的文件?
Say I have three files changed in the working dir (uncommitted) but I only want to stash 2 of them. FYI It doesn't seem to matter whether the uncommitted files are staged or not - when I use stash, they all get stashed.
假设我在工作目录中更改了三个文件(未提交),但我只想存储其中的 2 个。仅供参考 未提交的文件是否暂存似乎无关紧要 - 当我使用 stash 时,它们都会被暂存。
采纳答案by VonC
In command line, you would:
在命令行中,您将:
- add to the index the files you don't want to stash
- do a git stash save --keep-index, as mention in this answeror this one.
Since issue 479 of GitExtensions, you should be able to do the same, since there should be a checkbox to the stash form which appends '--keep-index
' to the 'stash save
' command.
自GitExtensions 的第 479 期以来,您应该能够执行相同的操作,因为存储表单中应该有一个复选框,将 ' --keep-index
'附加到 ' stash save
' 命令。
回答by Spyder
To add files to stash in GitExtensions: in the top menu click:
要将文件添加到 GitExtensions 中:在顶部菜单中单击:
Commands
Stash changes
命令
存储更改
To retrieve stash using GitExtensions, use the same menu, which will now contain a history of stash, select the file(s) you want to retrieve and then click 'Apply Selected'
要使用 GitExtensions 检索 stash,请使用相同的菜单,该菜单现在将包含 stash 的历史记录,选择要检索的文件,然后单击“Apply Selected”
回答by Wade Hatler
Pretty old question, but in the latest version of GIT Extensions, the "Manage Stashes" window has 2 buttons.
很老的问题,但在最新版本的 GIT 扩展中,“管理存储”窗口有 2 个按钮。
- Stash All Changes
- Stash Selected Changes
- 隐藏所有更改
- 隐藏选定的更改
The second one does the job. Pretty obvious in retrospect.
第二个完成工作。回想起来很明显。