Remove files not deleted when switching branches
git clean -f -d
Source: http://stackoverflow.com/questions/3885850/git-not-removing-files-when-switching-branch
Move folder including history from one git repo into another
\old_repo>git log --pretty=email --patch-with-stat --reverse --binary -- folder_name | (cd ../new_repo_path && git am)
Source: http://stackoverflow.com/a/11426261/1824988
Cloning with submodules
git clone --recursive git://github.com/foo/bar.git
or
git clone git://github.com/foo/bar.git
cd bar
git submodule init
git submodule update