Questions tagged [git-show]

Shows one or more objects (blobs, trees, tags and commits).

  • For commits it shows the log message and textual diff. It also presents the merge commit in a special format as produced by git diff-tree --cc.

  • For tags, it shows the tag message and the referenced objects.

  • For trees, it shows the names (equivalent to git ls-tree with --name-only).

  • For plain blobs, it shows the plain contents.

The command takes options applicable to the git diff-tree command to control how the changes the commit introduces are shown.

See the man page for more info.

78 questions
4
votes
2 answers

How to get rid of the ... at the output of the show command in Git

git show --stat --pretty=format: 50c2ebc0e Outputs: .git.ignore | 2 +- .../WebServiceRequests/WebService.cs | 78 ++++++++++---------- .../UI/Bin/AjaxControlToolkit.omi | 1 + Is there a…
Eran Chetzroni
  • 1,046
  • 2
  • 14
  • 27
4
votes
1 answer

How to get list of files in another branch without checkout

I want to list the files present in another branch without doing a checkout, and according to View a file in a different Git branch without changing branches, this command is sufficient: git show mybranch:mydir Unfortunately, the output is not…
Flux
  • 9,805
  • 5
  • 46
  • 92
4
votes
1 answer

Different git pager options for diff and show

I like my tabs displayed as 4 spaces, and for that I have the preference core.pager = 'less -x4'. I know that at this point I'm nitpicking, but I'd love for the leading tab to be 4 spaces even in diff mode, which is obviously the most commonly used…
Cimbali
  • 11,012
  • 1
  • 39
  • 68
3
votes
2 answers

Git Show of a merge commit listing more files than the merged files

I have 3 Feature branches and 1 Release branch. I merged code from Feature1 to Release having 2 commits. Then i am merging code from feature2 to Release having 1 commit. When i execute the git show command with 2nd merge commit its listing all the…
Asma
  • 99
  • 9
3
votes
1 answer

How can I get a list of conflicted files on merge commits (after the fact)

I'm trying to find merge revisions on projects that had conflicts in the past. Is there an easier way to do it than to replicate the merge by hand? Because I haven't been able to find a way to make git show list only the files where there were…
eftshift0
  • 26,375
  • 3
  • 36
  • 60
3
votes
0 answers

git show truncates output only when piped

If I execute git show f12345a --stat I get the following output: commit f12345a Author: This Guy Date: Mon Jul 1 14:00:59 2019 -0500 A commit …
Ordiel
  • 2,442
  • 3
  • 36
  • 52
3
votes
1 answer

Jgit: how to show changed files in merge commit

I'd like to use jgit to get a list of files that were changed in a merge commit, similar to what git show --name-only does in git. There are plenty of examples on how to get changed files for normal commits with one parent, but they do not work for…
Peter Knego
  • 79,991
  • 11
  • 123
  • 154
3
votes
1 answer

In git, how do I view a previous version of an image file?

I know I can git-show the previous version of a file, but I've got images in my repository! When I git show :, it unhelpfully opens them in a pager... It seems git show doesn't consider environment variables for this: I've…
3
votes
1 answer

git - Is git show safe to use on binary files when the output is redirected to a file?

I read that it's possible to retrieve a single file from a specific revision in Git, as answered in this SO question: How to retrieve a single file from specific revision in Git? So I want to know if it's safe to do that with binary files. I have…
user2672807
  • 1
  • 2
  • 7
  • 20
2
votes
1 answer

Why does git diff and git show seem to replace tabs with spaces?

When looking at changes in a code base containing tabs for indentation with git diff the tab characters are replaced by a number of spaces. The same happens when looking at patches with git show. When I use git format-patch and look at the resulting…
stefanct
  • 2,503
  • 1
  • 28
  • 32
2
votes
1 answer

git show: formatting is changed after redirection to file

I run git show --stat 2a340b71b280d60bbc29f8d8fe00b7da5760e2bb. I get: commit 2a340b71b280d60bbc29f8d8fe00b7da5760e2bb Author: xxx Date: Thu Apr 30 13:40:54 2020 +0200 xxx xxx.c | 1 + I run…
pmor
  • 5,392
  • 4
  • 17
  • 36
2
votes
1 answer

View diff contents of 1 specific stashed file in Git

Let's say I have 2 stashed files: $ git stash show a.txt | 2 +- b.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) I can view the complete diff of the stash: diff --git a/a.txt b/a.txt index bc56c4d..a688182 100644 --- a/a.txt +++…
Bas Peeters
  • 3,269
  • 4
  • 33
  • 49
2
votes
0 answers

Git -- View merge diff of merge conflict resolution with subsequent commits?

While working on a feature branch, I realized that merging master back into my feature-branch to keep it up to date would require some work and a code-review. So I branched off the feature, merged in master, and made some additional commits on the…
Gabriel Mahan
  • 449
  • 4
  • 4
2
votes
1 answer

How to get visual output when git reset modifies HEAD and Staging Index states?

For educational purposes, I am looking for a method to visually demonstrate how a git reset modifies HEAD and the Staging index. In the case of --mixed and maybe --hard I would like to get a before and after view of the Staging Index, to show how it…
kevzettler
  • 4,783
  • 15
  • 58
  • 103
2
votes
1 answer

Make different `pretty` settings for git-log and git-show

I have this setting in my .gitconfig: [format] pretty = oneline Which nicely formats my output of git-log. However it also changes the output of git-show (and git-status), which annoys me, because when I use git-show, I usually want to see more…
hgiesel
  • 5,430
  • 2
  • 29
  • 56