how to delete a local repository in git code example Example 1: git remove repository local $ rm -rf .git Example 2: clone and remove existing git repository git rm -rf git