Home > OS >  How do i delete a main branch?
How do i delete a main branch?

Time:08-03

I initialized a git repo while I was still at the desktop directory before creating a folder for my workspace, all files and folders on the desktop are now tracked and I can't figure out how to delete this. Whenever i try creating a new folder for my workspace on the desktop, the main branch is shown

CodePudding user response:

Simply move git folder to another location, some directory. To do so, find hidden .git folder on desktop, and move it with files which you'd like to track to separate repository. For Windows you could see hidden files like this - enter image description here


Linux, Mac, or Unix based operating systems


Open a terminal and navigate to the directory of your project, i.e. - cd path_to_your_desktop.

Run this command:

rm -rf .git*

This will remove the Git tracking and metadata from your project like the .gitignore files

  • Related