tags:

views:

459

answers:

2
  1. Looking for a command like 'ls -R' or 'dir/s' can list all files in a commit/branch.
  2. Is there any command can compare two files from different branch? Thanks! a lot!
+5  A: 
  1. git ls-tree -r --name-only <commit> (where instead of <commit> there can be <branch>).
    You might want to use also -t option which lists subdirectories before descending into them
  2. git diff <branchA>:<fileA> <branchB>:<fileB>,
    or if you want to compare the same file git diff <branchA> <branchB> -- <file>
Jakub Narębski
+2  A: 

To compare two files from different branches:

git diff branch_1..branch_2 file.txt

To list all files in a tree object:

git ls-tree -r branch
Dan Loewenherz