简体   繁体   English

在 SourceTree 中查看 Stash 的完整内容

[英]See full content of Stash in SourceTree

Is there a way in SourceTree to see the whole content of a stash? SourceTree 中有没有办法查看存储的全部内容?

I have stashed quite a bunch of changes that are not yet ready to be committed on the Develop branch in order to checkout the Master branch for a hotfix.我已经隐藏了很多尚未准备好在Develop分支上提交的更改,以便检查Master分支以获得修补程序。 Now I realize that one change in the stash would be good to include in the hotfix since I will anyway have to make a new deployment.现在我意识到存储中的一个更改最好包含在修补程序中,因为无论如何我都必须进行新的部署。 But since the stash is largish, I cannot see the particular change I want when I select the stash in SourceTree.但是由于存储空间很大,当我在 SourceTree 中选择存储空间时,我看不到我想要的特定更改。 For me, SourceTree shows only a part of the stash as some kind of summary...对我来说,SourceTree 只显示了一部分存储作为某种摘要......

I know that I can get around this in several different ways, but if there is an option somewhere that I don't know of which would make SourceTree show the full contents of the stash, I'd be very pleased if someone could tell me where to find it.我知道我可以通过几种不同的方式解决这个问题,但是如果有一个我不知道的选项会让 SourceTree 显示存储的全部内容,如果有人能告诉我我会很高兴在哪里可以找到它。

The repository is a GIT repository if that makes a difference...如果有所不同,则存储库是GIT存储库......

Can be fixed (in latest version?) by increasing the Max File Count and Max Diff Line Count in the Tools > Options > Diff :可以通过在Tools > Options > Diff中增加Max File CountMax Diff Line Count来修复(在最新版本中?):

在此处输入图像描述

For some reason I don't see the "Max File Count" field on SourceTree 4.0.1 (234) on macOS.出于某种原因,我在 macOS 上的 SourceTree 4.0.1 (234) 上看不到“最大文件数”字段。

One ugly trick to see the whole stash is:查看整个藏匿处的一个丑陋技巧是:

  1. Copy your project folder and open the folder with SourceTree.复制您的项目文件夹并使用 SourceTree 打开该文件夹。
  2. Discard all active changes.放弃所有活动更改。
  3. Apply your stash.应用你的藏品。
  4. Copy or check any code you might need.复制或检查您可能需要的任何代码。

This question have been asked here more than once .这个问题在这里被问过不止一次

git stash show -p stash@{0}

is the command you are looking for.是您要查找的命令。

Or if you want to add a small script you can do these following steps:或者,如果您想添加一个小脚本,您可以执行以下步骤:

git config --edit --global

under the [alias] section write:在 [别名] 部分下写:

whatsInStash = "!f() { git stash show -p stash@{$1}; }; f"

And to call it:并称之为:

git whatsInStash 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM