0

I do a mistake, I do "git init" at the opening of the console, when the path is on C:/Users/My Username. So now my entire disc C is the branch master while I wanted to do the git init on a file from my desktop. So how to remove this branch in order to fix my problem do what i want ? Thank's :)

Cohchi
  • 543
  • 3
  • 9
  • 19
  • 3
    Just delete the `.git` directory in whatever directory you ran the command in. – Oliver Charlesworth Jun 16 '17 at 17:24
  • Does this answer your question? [How do I remove version tracking from a project cloned from git?](https://stackoverflow.com/questions/4754152/how-do-i-remove-version-tracking-from-a-project-cloned-from-git) – starball Aug 12 '23 at 21:34

2 Answers2

0

If you did the git init in C:/Users/Username, then why should your whole C: be in the repo? o_O

Everything Git-specific is in .git of the root directory of the repository. So if you did init a Git repo in C:/Users/Username, delete C:/Users/Username/.git. If you did init a Git repo in C:, delete C:/.git.

Vampire
  • 35,631
  • 4
  • 76
  • 102
0

How to Remove Git from the Project? To remove Git from a project we can remove the .git folder using the Git command.

rm -rf .git*