0 votes
1 view
in DevOps and Agile by (20k points)
Is it possible to open a file in a git branch without checking out that branch? How?

Essentially I want to be able to open a file in my GitHub pages branch without switching branches all the time. I don't want to modify it, just want to view it.

1 Answer

0 votes
by (28.4k points)

The following command will do

$ git show branch:file

Here, branch can be any ref (branch, tag, HEAD, ...) and file is the full path of the file. In order to export it you could use

$ git show branch:file > exported_file

Welcome to Intellipaat Community. Get your technical queries answered by top developers !