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