I recommend to use this method.

Edit composer.json and add this line.
"config": {
"preferred-install": "dist"
}

Remove all folder in vendor and run composer install. Folder .git should not appear in vendor folder anymore.