User Tools

Site Tools


git_show

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
git_show [2019/02/24 08:13]
rpjday [Showing some version of a root directory file]
git_show [2019/02/24 08:15]
rpjday [The general form]
Line 93: Line 93:
 </​code>​ </​code>​
  
-===== Showing files and directories ​=====+===== Showing files =====
  
 ==== The general form ==== ==== The general form ====
  
 <​code>​ <​code>​
-$ git show <​commit>:<​pathspec>+$ git show <​commit>:<​filename>
 </​code>​ </​code>​
 ==== Showing some historical version of a file ==== ==== Showing some historical version of a file ====
Line 113: Line 113:
  
 ==== Showing a file in the current directory ==== ==== Showing a file in the current directory ====
 +
 +You need to use the ''​./''​ syntax:
  
 <​code>​ <​code>​
 +$ cd scripts/
 $ git show HEAD:​./​Makefile $ git show HEAD:​./​Makefile
-$ git show v4.12:./Makefile+$ git show v4.19:./Makefile
 </​code>​ </​code>​
  
 ==== Showing the staged version of a file ==== ==== Showing the staged version of a file ====
 +
 +If you leave off the commit part, you're referring to the index:
  
 <​code>​ <​code>​
git_show.txt ยท Last modified: 2019/02/24 08:17 by rpjday