Git cat put the file in stdout

I put the parts of the file in git like this

git add --patch ./file 

I would like to output the contents of a phased file to stdout.

Please note that the step-by-step file and the file in the working directory are different, since I only put the parts of the file.

+4
source share
1 answer

If you just want to display the full file in your phased version, you can use the syntax suggested by gradation in response to a recent question:

 git show :file 

... or if you want to see the changes between HEAD and the index for this file (usually the changes you just made), you can use:

 git diff --cached -- file 
+5
source

Source: https://habr.com/ru/post/1342104/


All Articles