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
2
votes
2 answers

Difference between git show and git log when displaying commit ids

I need to get list of commit ids between two known commits. I used the following command: git show --format=format:%H --quiet commitA...commitB It works flawlessly until there is a merge commit. I.e.: * c36a37b |\ | * 92187d9 * | e24d2c4 |/ *…
fracz
  • 20,536
  • 18
  • 103
  • 149
2
votes
1 answer

Why is 'git show' coming back empty?

I am trying to get (statistical) commit information from a repo. I therefore did: $ git clone remote/path/to/repo localrepo && cd localrepo $ git pull $ git show --since 'Oct-03-2014' --until 'Oct-13-2014' --shortstat Generally, if there are commits…
Virgil Gheorghiu
  • 493
  • 1
  • 4
  • 13
2
votes
3 answers

what happened to a commit that doesn't show up in any branches but available in "git show"

I have a commit id available in the bare repo. git show commit id, shows the commit with the changes. But the same commit doesn't show up when using the below commands git branch --contains or git reflog show --all | grep
Senthil A Kumar
  • 10,306
  • 15
  • 44
  • 55
1
vote
2 answers

What is the difference between "git show test.rb" and "git show HEAD:test.rb"?

Could you explain the difference between git show test.rb and git show HEAD:test.rb? The command git show HEAD:test.rb returns: test file contents while git show test.rb returns: commit a8e90b3dbf4eed03cdbb3cd3b99f98e9153c7219 Author: Misha…
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
1
vote
0 answers

Is there any way to see which commit is cherry-picked to a commit?

Assume that there are two branch develop and master. They are like this (alphabets are commits), master was created based on develop at B: A — B — C — D (develop) A — B — E — F — (C cherry-picked) — G — H (master) How can I confirm C cherry-picked…
kensuke1984
  • 949
  • 1
  • 11
  • 21
1
vote
2 answers

Git show : view file in my usual editor, Qt Creator

I use Git (2.39.2.windows.1) and Qt Creator 7.0.2 on Windows 10. I would like Git to show me files at specific revisions (as in git show :) in the instance of Qt Creator that is currently open. Alternatively, Qt…
Charles
  • 988
  • 1
  • 11
  • 28
1
vote
3 answers

git checkout commit with specific trailer

I have an orphan branch (let's call it output) which contains the documents generated by templates stored on my main branch. I would like to checkout the commit on output that correspond to a specific commit on main. I settled on using git commit…
ITChap
  • 4,057
  • 1
  • 21
  • 46
1
vote
1 answer

How to find deleted files in a single commit in gitlab

git show -m -1 --name-only --pretty=format: --stat --relative --first-parent commit_id I am using above command to list all the files in a commit. It is listing all the deleted files as well. I want to remove deleted files from my list. Is there…
Asma
  • 99
  • 9
1
vote
1 answer

Can I apply a whole commit from a file created with git show?

Is there a way to create a new commit in Git, using a file which provides both the changes and the commit message, like the output from git show does? It would be nice when the other metadata fields, like Author, AuthorDate and so on would also be…
philipp2100
  • 162
  • 1
  • 11
1
vote
1 answer

get the full filepath before and after file renaming in git log

Suppose I know that a file has been renamed (rename can happen by renaming the filename or moving the file into another directory) into a specific commit. git show --summary shows all instances of such renaming in the commit. However, git only…
Nasif Imtiaz Ohi
  • 1,563
  • 5
  • 24
  • 45
1
vote
1 answer

Git stash silently hides/deletes staged changes

Problem: $ git status -s MM myfile $ git stash save $ git show stash@{0} # Only shows unstaged changes NOT staged changes # To debug: $ GIT_TRACE=2 git stash show trace: exec: 'git-stash' 'show' trace: run_command: 'git-stash' 'show' trace:…
Matt Kneiser
  • 1,982
  • 18
  • 23
1
vote
1 answer

How do I get file blob SHA1s in git show (diffstat)?

Is there a way to get the SHA1 of a file blob (note: not the SHA1 of the commit) in a diffstat like format? What I would like to do is do something like git show --stat ${commit} but instead of showing just the filename and the number of lines…
R.M.
  • 3,461
  • 1
  • 21
  • 41
1
vote
2 answers

How to invoke `git show` only for the latest fetched branches?

I've repository with hundreds of branches and I'd like to run git show only for these which have been recently fetched or updated as shown by git fetch, e.g. $ git fetch tester From repo:Foo/Bar * [new branch] Foo -> origin/Foo …
kenorb
  • 155,785
  • 88
  • 678
  • 743
1
vote
2 answers

"fatal: tag 'someTag' already exists", when trying to add a tag to old commits

Question Why can I not add a tag to two older commits? git tag -a matlabTest cfa84dbb6dd3c2c9956421e723d2f99786f7b417 git tag -a matlabTest 45b3a4d83eece8a5adcb947392f15a14bd4b0e63 Instead I am getting: fatal: tag 'matlabTest' already exists It…
hello_there_andy
  • 2,039
  • 2
  • 21
  • 51
1
vote
1 answer

"git show" command showing previous commit

I'm trying to show the contents of a file in a specific commit, this is the command I'm using: git show ($commit)^:($filename) However, it's showing contents of the previous commit. I'm not sure if this command is supposed to get the contents…
nancyheidilee
  • 322
  • 1
  • 2
  • 10