Git view files in another branch without checkout

If you like to view a file in another branch without (without checking it out) you can do this:

git show branch:file

So if you are in a branch called Feature_fancy and there is a file called fancy_controller.js:

git show Feature_fancy:fancy_controller.js

This will show the content of the file without having to check out this branch.

Sharing is caring Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisEmail this to someoneShare on Reddit