# Undo git init command

**URL:** https://forum.codewithmosh.com/t/undo-git-init-command/1067
**Category:** Git
**Created:** [December 1, 2020, 11:10pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067 "2020-12-01T23:10:16Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)
#### Post date: [December 1, 2020, 11:10pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/1 "2020-12-01T23:10:16Z")

</div>

Hi,  
Does anyone know how can i undo `git init` command ?  
I’m not familiar with `git` so i don’t know if what i’m asking is even possible 🙂  
Thank you in advance ❤

---

<div class="post-metadata">

### Author: ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)
#### Post date: [December 1, 2020, 11:22pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/2 "2020-12-01T23:22:08Z")

</div>

I found this reply on :

> <https://github.com/facebook/create-react-app/issues/8023>

You’re running `rm -rf` in powershell, which doesn’t have rm. You can use `del` .  
It worked, but is there any other way that is more elegant and reasonable ? something that mosh might explained in his **GIT** course ?

---

<div class="post-metadata">

### Author: ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)
#### Post date: [December 2, 2020, 6:15am UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/3 "2020-12-02T06:15:08Z")

</div>

Just delete the `.git` directory.

---

<div class="post-metadata">

### Author: ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)
#### Post date: [December 2, 2020, 3:11pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/4 "2020-12-02T15:11:33Z")

</div>

When i delete .`git` this is what i get.

 ![Remove Git](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/1X/082c56e7154dbac7a1df8f0e1925ca5a47c31a7c.png)

---

<div class="post-metadata">

### Author: ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)
#### Post date: [December 2, 2020, 3:24pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/5 "2020-12-02T15:24:12Z")

</div>

If that’s not what you expected try deleting .gitignore also.

---

<div class="post-metadata">

### Author: ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)
#### Post date: [December 2, 2020, 3:28pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/6 "2020-12-02T15:28:49Z")

</div>

So i did `rm -force .git` and it worked 🙂

 ![Git Removed](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/1X/3f62939abb9d2e1ddcaae3f41d7ff93bbbf6ba2a.png)

But in his git course is it going to be like this ? Windows users must suffer finding the right command ?  
For instance mosh uses `open .git` and .git directory will show up, but didn’t say what windows users should do, I knew that the equivalent of `open` in mac is `start` in windows, but what if someone doesn’t know and get frustrate to continue the course ?

---

<div class="post-metadata">

### Author: ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)
#### Post date: [December 2, 2020, 3:38pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/7 "2020-12-02T15:38:02Z")

</div>

I have no idea what you are talking about but someone who wants to program a computer should first be able _use_ it.

---

<div class="post-metadata">

### Author: ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)
#### Post date: [December 2, 2020, 4:48pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/8 "2020-12-02T16:48:53Z")

</div>

> [@A100D-JS](#):
>
> but didn’t say what windows users should do

Mosh says “_and if you’re on Windows you can open it with ‘Windows Explorer’ or ‘File Explorer’ - I’m not sure what it’s called these days_” - so he does says what windows users should do. Regardless, someone who wants to become a software developer should be able to do every day tasks like listing the contents of a directory on his/her own.

---

<div class="post-metadata">

### Author: ![joshuamwolfe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/joshuamwolfe/32/243_2.png) [@joshuamwolfe](https://forum.codewithmosh.com/u/joshuamwolfe)
#### Post date: [December 2, 2020, 6:32pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/9 "2020-12-02T18:32:06Z")

</div>

I recently switched to linux - zorin os kernal. I love it, and highly reccomend it. It’ll save you a lot of head ache.

---

<div class="post-metadata">

### Author: ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)
#### Post date: [December 2, 2020, 6:54pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/10 "2020-12-02T18:54:55Z")

</div>

What you’re saying is true but since it’s a comprehensive course and most of the work gets done on the cmd i want to know what is the command line to use not using File Explorer.  
Or he could at least create a cheatsheet to differentiate mac commands from windows such as `ls `which is for mac and `dir` for windows.

I wasn’t able to find the answer on the web i just figured it out myself and it’s fine but i purchased the course to save time and learn fast

---

<div class="post-metadata">

### Author: ![joshuamwolfe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/joshuamwolfe/32/243_2.png) [@joshuamwolfe](https://forum.codewithmosh.com/u/joshuamwolfe)
#### Post date: [December 2, 2020, 6:59pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/11 "2020-12-02T18:59:00Z")

</div>

So I am curious, what was your solution?

---

<div class="post-metadata">

### Author: ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)
#### Post date: [December 2, 2020, 6:59pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/12 "2020-12-02T18:59:44Z")

</div>

> [@Undo git init command](https://forum.codewithmosh.com/t/undo-git-init-command/1067/6):
>
> So i did rm -force .git and it worked slightly_smiling_face But in his git course is it going to be like this ? Windows users must suffer finding the right command ? For instance mosh uses open .git and .git directory will show up, but didn’t say what windows users should do, I knew that the equivalent of open in mac is start in windows, but what if someone doesn’t know and get frustrate to continue the course ?

Just look at the picture i’ve sent

---

<div class="post-metadata">

### Author: ![Salil-cmd](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@Salil-cmd](https://forum.codewithmosh.com/u/Salil-cmd)
#### Post date: [June 7, 2021, 7:05pm UTC](https://forum.codewithmosh.com/t/undo-git-init-command/1067/13 "2021-06-07T19:05:29Z")

</div>

To delete a git repository (that means the folder is no longer a git repository)  
$ rm -rf .git
