Git show whole file changes

Is there a way to get the git show command to show the whole contents of a file when viewing a commit? For example: if it currently show something like

foo.cpp

+++ int main() {
+++    std::cout << "HELLO" << std::endl;
+++ }

I would want the output to say:

  • How to find out what changes on a branch after merges from master?
  • Check diff against file on the server
  • git diff renamed file
  • Show both staged & working tree in git diff?
  • Is there any formal way or known way to canonicalize an xml file to generate diffs?
  • Git merge - manual merge - forcing conflic having WHOLE old and new file version
  • foo.cpp
    
    #include <stdio> //assuming this was from an earlier commit
    
    +++ int main() {
    +++    std::cout << "HELLO" << std::endl;
    +++ }
    

    Is there a simple way to do this?

  • How make Eclipse/EGit recognize existing repository information after update?
  • Issues with Eclipse using packages
  • How do I remove deleted Git branches from Visual Studio 2015
  • How do I see files that have diverged on two Git branches?
  • No module named ib.message
  • Git log says file is there but cannot checkout
  • One Solution collect form web for “Git show whole file changes”

    This is kind of a hack, but git show (like git diff) has the -U option that lets you specify how many lines of context to show. If you use a number that’s bigger than the region between the difference and the start or end of the file, then it’ll show the whole file. So if you use a really big number, it’ll work the way you want on (hopefully) any file you try it on:

    git show -U99999
    
    Git Baby is a git and github fan, let's start git clone.