Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
381 views
in Technique[技术] by (71.8m points)

git - 看看什么是藏匿而不申请[重复](See what's in a stash without applying it [duplicate])

Possible Duplicate:

(可能重复:)
Is it possible to preview stash contents in git?

(是否可以在git中预览藏匿内容?)

I see here you can apply/unapply a stash and even create a new branch off of a stash.

(我在这里看到你可以申请/取消申请藏匿,甚至可以从藏匿处创建一个新的分支。)

Is it possible to simply see what is inside the stash without actually applying it?

(是否有可能只是在没有实际应用它的情况下简单地看到藏匿处内的东西?)

  ask by Chris Abrams translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

From the man git-stash page:

(从man git-stash页面:)

The modifications stashed away by this command can be listed with git stash list, inspected with git stash show

(这个命令隐藏的修改可以用git stash列表列出,用git stash show进行检查)

show [<stash>]
       Show the changes recorded in the stash as a diff between the stashed state and
       its original parent. When no <stash> is given, shows the latest one. By default,
       the command shows the diffstat, but it will accept any format known to git diff
       (e.g., git stash show -p stash@{1} to view the second most recent stash in patch
       form).

To list the stashed modifications

(列出隐藏的修改)

git stash list

To show files changed in the last stash

(显示上次存储中更改的文件)

git stash show

So, to view the content of the most recent stash, run

(因此,要查看最近藏匿的内容,请运行)

git stash show -p

To view the content of an arbitrary stash, run something like

(要查看任意存储的内容,请运行类似的内容)

git stash show -p stash@{1}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...