-2

I need to work on another branch, and don't know which branch. Several are listed and I can determine which branch I need based on the contents of certain key files. Is there a way to just take a peek at some of the files in the branches? Also, is this where I use stash?

Yimin Rong
  • 1,698
  • 4
  • 28
  • 47

1 Answers1

4
git show branch:file

Will work :)

You can also run

git grep pattern branch

So you can grep files from other branches

You can use git checkout to bring the file from the other branch.

Marco
  • 2,696
  • 17
  • 23