分类: 项目管理
2012-03-29 15:03:28
above will produce the differ in two branches if you would refer to find the diff from their common ancestor to test, you can use dots instead of two:
git diff master...test
what you will commit:
you will commonly use git diff to figuring out differences between your last commit, your index, your working directory, a common use is to simply run
git diff
which will show you changes in working directory that are not yet staged for the next commit, if you want to see what is staged for the next commit you can run
git diff –cached
also you can run git diff HEAD which shows changes in working directory since you last commit.
if you want to see how you current working directory differs from the state of the project in another branch, you can run something like
git diff test
this will show you what is different between your current directory and the snapshot on the test branch
you can also limit the comparison to specific file and subdirectory by add a path limiter:
git diff HEAD – ./LIB