是否有可能在git中预览隐藏内容? [英] Is it possible to preview stash contents in git?

查看:98
本文介绍了是否有可能在git中预览隐藏内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常会把工作放在后面,然后会有其他的东西出现,几个星期后,我想检查存储器,并找出如果我将它应用到当前状态下的工作树会发生什么变化。



我知道我可以在存储上做一个git diff,但是这显示了工作树和存储之间的所有区别,而我只是想知道

我该怎么做?

解决方案

div>

git储存显示会显示您最近储存中已更改的档案。您可以添加 -p 选项来显示差异。

  git隐藏显示-p 

如果您感兴趣的存储不是最新的存储,请添加

  git stash show -p stash @ {2} 


I often put work away for later, then other stuff comes along, and a few weeks later, I want to inspect the stash, and find out what changes it would make if I applied it to working tree in its current state.

I know I can do a git diff on the stash, but this shows me all the differences between the working tree and the stash, whereas I'm just interested to know what the stash apply is going to change.

How can I do this?

解决方案

git stash show will show you the files that changed in your most recent stash. You can add the -p option to show the diff.

git stash show -p

If the stash you are interested in is not the most recent one, then add the name of the stash to the end of the command:

git stash show -p stash@{2}

这篇关于是否有可能在git中预览隐藏内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆