Deleting a Local GitHub Repository
Posted: Thu Jul 21, 2022 5:26 am
If you want to delete a local Github Repository that was cloned from to local computer without touching or making any changes to the Remote GitHub repository then follow the commands below:
Step 1: Go into your project file
With the deletion of the ‘.git’ file, this will delete the .git file that contains a log of the commit history, its information, and also remote repository address from the working directory. We can think of this deletion as when we do git init to initialize the current working directory as Git directory, with the above command we are just reverting it back to not being a Git directory.cd <project_name>
rm -rf <repository_folder>.git
Then what about the files and folder in the present working directory?
This has to be deleted using the following set of command:
Go to the directory where the project is present (Note: Don’t go inside the project file).
rm -rf <folder_name>