-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,890
  • 4
  • 31
  • 48

1 Answers1

5
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,796
  • 19
  • 24