Friday, August 31, 2012

Git :: Show a file from other branch


Sometimes yo need to view the contents of a file in other branch, without doing a checkout. This is super easy with git:
git show branch:file
 
Where branch can be any ref (branch, tag, HEAD, ...) and file is the full path of the file.
To store the file for a later read:

git show branch:file > exported_file 
 
 
(via http://stackoverflow.com/a/7856446/1265056 ) 

No comments:

Post a Comment