gitcmd.sh: skip build directories

Try to figure out if the directory is actually part of a build tree. In this
case meta-intel-iot-devkit had some build directories inside the layer which
were failing.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>