gsusmonzon

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 ) 
Posted by gsusmonzon at 11:23 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

About Me

My photo
gsusmonzon
View my complete profile

Search This Blog

Blog Archive

  • ►  2021 (1)
    • ►  October (1)
  • ►  2019 (1)
    • ►  October (1)
  • ►  2017 (2)
    • ►  August (1)
    • ►  June (1)
  • ►  2016 (2)
    • ►  September (2)
  • ►  2015 (2)
    • ►  July (1)
    • ►  June (1)
  • ►  2014 (7)
    • ►  December (1)
    • ►  October (1)
    • ►  May (2)
    • ►  March (2)
    • ►  February (1)
  • ►  2013 (9)
    • ►  November (1)
    • ►  September (1)
    • ►  August (2)
    • ►  July (2)
    • ►  May (2)
    • ►  March (1)
  • ▼  2012 (11)
    • ►  November (2)
    • ►  September (1)
    • ▼  August (1)
      • Git :: Show a file from other branch
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ►  2011 (12)
    • ►  December (1)
    • ►  October (1)
    • ►  September (4)
    • ►  May (2)
    • ►  April (2)
    • ►  March (2)
Simple theme. Theme images by duncan1890. Powered by Blogger.