background
The git warehouse we sometimes build looks like this. There are three modules (folders) b, c, and d in the a directory. Sometimes we only want to check the changes under b, but when using git status
, git diff
the changes in c and d will be listed. How can we only check the changes in the b directory?
operate
To check the changes in the b directory, cd to the b directory, and then use git status .
and git diff .
, git checkout .
. The command is only for the current b directory, as if a separate git warehouse was built in the b directory.