I know there's git cat-file
but it takes a sha
what I want to do is something like git cat-file mybranch -- path/to/myfile.txt
which would accomplish the same thing as
git checkout mybranch && cat path/to/myfile.txt
except it wouldn't actually checkout the branch. How can I do this?
You can do it in many ways:
git cat-file blob mybranch:path/to/myfile.txt
or
git show mybranch:path/to/myfile.txt
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.