- Looking for a command like 'ls -R' or 'dir/s' can list all files in a commit/branch.
- Is there any command can compare two files from different branch? Thanks! a lot!
views:
459answers:
2
+5
A:
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 themgit diff <branchA>:<fileA> <branchB>:<fileB>
,
or if you want to compare the same filegit diff <branchA> <branchB> -- <file>
Jakub Narębski
2009-12-15 22:19:01
+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
2009-12-15 22:19:22