remove cloned git repository code example Example 1: git remove repository local $ rm -rf .git Example 2: clone and remove existing git repository git rm -rf git