@rem Project folder r:\testproject, feel free to change the drive letter if necessary r: md testproject cd testproject @rem initialize repo cmd /c git init @rem create dummy file as super project ECHO This is the super project > main1.txt cmd /c git add main1.txt cmd /c git commit -m "Initial commit for the Super Project" @rem add a second line to main1.txt to verify git diff is working before adding submodule ECHO add the second line >> main1.txt cmd /c git status cmd /c git diff --cached cmd /c git diff cmd /c git diff HEAD @rem no problem found up to this point. @rem all three git diff command complete succefully @rem set submodule, use cakephp as submodule cmd /c git submodule add git://github.com/cakephp/cakephp.git @rem git diff --cached still works properly after adding the submodule cmd /c git diff --cached @rem the next two lines will crash my command prompt when execute cmd /c git diff cmd /c git HEAD