Remove the .git folder conditionally

Use a variable to check whether the .git folder must be removed, in
some cases projects require to keep the .git folder and therefore an
option should be present to skip this task.