Skip to content

Git Notes Removing Repositories

Randy McDermott edited this page Sep 2, 2020 · 2 revisions

We all sometimes get our repos into a spaghetti mess and need to use the nuclear option to move on. The thing to remember is that the magic of a Git repo is stored in the .git folder at the top level of the repository. If you are in the fds repo, for example, you might see

$ pwd
/Users/rmcdermo/GitHub/FireModels_rmcdermo/fds
$ ls -a
.                  .git               Build              LICENSE.md         Source             Verification
..                 .gitattributes     CODE_OF_CONDUCT.md Manuals            Utilities
.gitignore         CONTRIBUTING.md    README.md          Validation

If you can live with getting rid of everything in the fds folder, then to delete the repository simply do

$ cd ..
$ pwd
/Users/rmcdermo/GitHub/FireModels_rmcdermo
$ rm -rf <repo name>

where, for example, <repo name> = fds.

If you do not want to lose everything, it is possible to simply rename the directory.

$ pwd
/Users/rmcdermo/GitHub/FireModels_rmcdermo
$ mv <old repo name> <new repo name>
Clone this wiki locally