Git: View a file in a different branch
To view a file in a different git branch (without checking it out) you can run the following:
git show <branch>:<file>
Bonus points for piping it to your favorite editor:
git show feature/add-all-the-things:css/cool.css | vim -R -
Written by Chris Jaure
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Branch
Authors

niklongstone
42.01K

muzzlefork
11.98K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#