How to Remove & Delete a Local Git Repository

  Рет қаралды 77,323

Cameron McKenzie

Cameron McKenzie

2 жыл бұрын

Need to delete a Git repo? Was the local repo to delete created with Git init?
If you are having a problem deleting your local Git repo, we have the solution to your problem. Just run the following command:
rm -fr .git
That command will delete the hidden .git folder in which all of your local Git configuration for the local repository is stored. Once that Git repo delete command is performed, the local git repository will be gone for good.
Another option is to just unhide all hidden directories. That's why the deletion of a Git repo causes people problems - they don't realize the .git folder is hidden. But if you unhide it, you can just do a right-click and delete, and the local Git repo will be removed for good.

Пікірлер: 91
@heartcurious_snowman
@heartcurious_snowman Жыл бұрын
Thank you Cameron! It was short and sweet, instructive and a touch of humour to mix it all together.
@walliswilliams394
@walliswilliams394 2 жыл бұрын
Thank you so much. I was in tears trying to figure out this problem before I found this video!
@noblessus
@noblessus Жыл бұрын
This is how i suspected it would work but I had to make sure I was doing it right. Thanks for the very clear video explaining everything!
@kshitizsinghchauhan7464
@kshitizsinghchauhan7464 2 жыл бұрын
Thank you so much for this ! Spent hours in trying to figure out !
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Glad I could be of help!
@TheGirInWonderland
@TheGirInWonderland 2 жыл бұрын
I needed this tip for a while! thanks a million
@cameronmcnz
@cameronmcnz 2 жыл бұрын
So glad I could help! There's so much undocumented stuff in Git. Feels good to fill a few of the gaps.
@KarimGitHub
@KarimGitHub Жыл бұрын
Thanks for the information brother Cameron McKenzie. Karim from Tunisia
@ravv27
@ravv27 Жыл бұрын
Thanks, very helpful tutorial!
@vizcarraorozco4740
@vizcarraorozco4740 8 ай бұрын
awesome, straight and to the point, thanks for making the video and sharing it!
@cameronmcnz
@cameronmcnz 8 ай бұрын
When I was learning Git, I was so frustrated by long tutorials that never answered my questions. I've tried to do a lot of short ones. Sadly, the KZbin algo favors videos over 8 minutes, so these don't get as much visibility as I really wish they should!
@user-kn4oi9oh4i
@user-kn4oi9oh4i 7 күн бұрын
the video i was looking for! Thank you good sir
@aburaihan6123
@aburaihan6123 2 жыл бұрын
Thank you so much, buddy. It was really helpful for me.
@cameronmcnz
@cameronmcnz 2 жыл бұрын
What's funny is I buy a T430 every few months, and I always have to come back to this video to remind myself how to delete that darn Lenovo partition. lol. Glad I could help!
@judewalker3147
@judewalker3147 2 жыл бұрын
Your the best, this was so helpful thank you :)
@9dwd
@9dwd Жыл бұрын
Hi Cameron Thanks so much, you are so helpful 🙏🙏🙏🙏🙏
@eslammohamed9866
@eslammohamed9866 Жыл бұрын
thank you so much i have problem for four days , you best youtuber
@cameronmcnz
@cameronmcnz Жыл бұрын
So glad I could be of help. One thing I will say is you're not alone. So many other people have had the same frustrating trouble deleting their Git and GitHub repos.
@arhamulfajar6701
@arhamulfajar6701 Жыл бұрын
Thank youu so much, very helpful tutorial
@nashrullahdehan
@nashrullahdehan Жыл бұрын
Thank you so much for the help
@DefaultFlame
@DefaultFlame 2 ай бұрын
Thank you so much for sharing this. I was getting to the stage of tearing my hair out. I'm very new to Linux and this helped immensely.
@mahibulislamratul2162
@mahibulislamratul2162 Жыл бұрын
thank you very much brother ....take love 🥰
@duypkthg592
@duypkthg592 Жыл бұрын
Thank you very much, it really helps me a lot🥰
@MrRNDubleBarrel
@MrRNDubleBarrel 2 жыл бұрын
Thank you very much.
@katarzyna.9330
@katarzyna.9330 Жыл бұрын
Thank you for this video.
@dny.____stetus5879
@dny.____stetus5879 Жыл бұрын
Very thankful your help sir 🙏🙏
@edivaldoluisbonfim3194
@edivaldoluisbonfim3194 Жыл бұрын
Helped me a lot
@JS-gf5xp
@JS-gf5xp Жыл бұрын
Thank you so much sir 🙏
@adeuyianjolaoluwa
@adeuyianjolaoluwa 2 жыл бұрын
Great value learnt
@user-el9kk8mn5o
@user-el9kk8mn5o 2 жыл бұрын
It's working so good thanks alot
@umloiro3219
@umloiro3219 4 ай бұрын
Thank you! It was saying permission denied and stuff but this helped
@cameronmcnz
@cameronmcnz 4 ай бұрын
Git makes hard things simple. But Git also has this bad habit of sometimes making simple things hard. Glad I could help you out!
@JOSEPH-bx1lu
@JOSEPH-bx1lu Жыл бұрын
Great video thanks
@coffeetea5915
@coffeetea5915 20 күн бұрын
i-it was that easy....Thanks for saving my life sir.
@Aleazandrio
@Aleazandrio Жыл бұрын
Three hours... Thank you.
@prof.mangabhai
@prof.mangabhai Жыл бұрын
Thank you so much, the rm -gr .git was not working in my system for some reason and I was really stressed to delete that repo
@franzsaijem
@franzsaijem Жыл бұрын
bro, thank you so much, subscribed
@cameronmcnz
@cameronmcnz Жыл бұрын
It's appreciated! I'll try and create great content for you.
@doancarlosembara3060
@doancarlosembara3060 2 жыл бұрын
thank you!
@ivanphone4917
@ivanphone4917 2 жыл бұрын
Thanks. Have now deleted my git repo.
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Glad I could help show you how to delete your Git repo!
@user-yf9jj4gd2t
@user-yf9jj4gd2t Жыл бұрын
saves me every time
@christiancarter255
@christiancarter255 Жыл бұрын
How do I remove project from a repo that was made in Visual Studio 2022?
@alexkondaurov7774
@alexkondaurov7774 2 жыл бұрын
my first comment. Thank you for your help. I spend 10 h to try to find how to delete this repo.!!!! You best
@chordleconcept9915
@chordleconcept9915 3 ай бұрын
does the rm -fr .git stops the tracking of files that might be in it ?
@yogeshshinde3323
@yogeshshinde3323 Жыл бұрын
Thank you so much.
@cameronmcnz
@cameronmcnz Жыл бұрын
Glad I could help!
@mohitchoure4111
@mohitchoure4111 2 ай бұрын
Thanks it save my time
@cameronmcnz
@cameronmcnz 2 ай бұрын
Glad I could help!
@harshitmehta5171
@harshitmehta5171 2 жыл бұрын
Thanks to help me out of this
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Glad I could help!
@silviodalloglioneto2698
@silviodalloglioneto2698 Жыл бұрын
Nice!
@sahityareddy6463
@sahityareddy6463 2 жыл бұрын
Thanks!
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Glad I could help!
@shoxruxnurmuxammedov7181
@shoxruxnurmuxammedov7181 2 жыл бұрын
just Perfect !
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Thanks so much!
@user-rw8en1jp4t
@user-rw8en1jp4t 9 ай бұрын
Thanks
@ederEngine
@ederEngine 2 жыл бұрын
gracias buen video
@cameronmcnz
@cameronmcnz 2 жыл бұрын
My pleasure!
@davidjohnsonny
@davidjohnsonny 2 жыл бұрын
thx buddy!
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Glad I could be of help. Seems like there's a lot of people seeking out the same thing.
@alonsofigueroamoreno8590
@alonsofigueroamoreno8590 2 жыл бұрын
thank u Sir. Can I ask, since when do you program?
@cameronmcnz
@cameronmcnz 2 жыл бұрын
A little bit here and there for the past 15 years.
@ucokkocok8832
@ucokkocok8832 2 жыл бұрын
hey, can we restore the repository? i accidentally set desktop folder into repository and i delete it with rm -fr then my desktop folder is gone include all the file such a pdf, word, txt and other and i can't refresh it. Can you help me?
@hersheynaik3029
@hersheynaik3029 2 жыл бұрын
Hey did u find the solution?? Even I have set my desktop to git init and I don't know the way back now.
@nashrullahdehan
@nashrullahdehan Жыл бұрын
Oh thats so sad.😨😟
@Arthur-ex6lf
@Arthur-ex6lf 5 ай бұрын
my idol
@cameronmcnz
@cameronmcnz 5 ай бұрын
I'm here to serve! Have fun with Git!
@y.yasemin
@y.yasemin 4 ай бұрын
I mistakenly did git init in my home directory. And then also proceeded to do git add . But I canceled it. Now I have a bunch of untracked files. Will this also delete my files that I have on my computer?
@cameronmcnz
@cameronmcnz 4 ай бұрын
Just find the hidden .git folder and delete that folder. Once that's gone, there's no evidence Git was ever initialized in that folder at all. You can just do it with Windows Explorer. Keep is simple!
@onebigsnowball
@onebigsnowball Жыл бұрын
Remove-Item : A parameter cannot be found that matches parameter name 'fr'.
@aritraganguly3957
@aritraganguly3957 7 ай бұрын
Same . Did you get the solution to that ?
@nitrorex2058
@nitrorex2058 Жыл бұрын
good
@moiseseastland8643
@moiseseastland8643 2 жыл бұрын
If the Repo has untracked or modified files that are not committed will those related files be deleted also?
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Yeah, cuz we are going to the file systems and blasting everything here.
@moiseseastland8643
@moiseseastland8643 2 жыл бұрын
@@cameronmcnz ok cool thanks because I was worried because my git has been in gridlock for months unable to add,commit, push or pull
@cameronmcnz
@cameronmcnz 2 жыл бұрын
@@moiseseastland8643 Well, that's a very strange situation. Is everything on GitHub or GitLab? You could always clone to a different folder. Or even try to do a local filesystem clone of the repo that isn't working and see if things work properly on the local clone. Always lots of options with Git.
@10ensura
@10ensura 17 күн бұрын
cmd ain't is still there... but remove manually is works ty
@praveenb-xr
@praveenb-xr Жыл бұрын
Not working Fully. it deleted most of the folders but there is objects> b2 there and shows corrupted or unreadable when deleting vi explorer the git rm fr also not deleting it rm: cannot remove '.git/objects/b2': Directory not empty
@cameronmcnz
@cameronmcnz Жыл бұрын
The corruption may be a bigger issue than what git is designed to solve.
@praveenb-xr
@praveenb-xr Жыл бұрын
@@cameronmcnz Today the drive showed notification to fix drive with retsrat. then disk checking happend. Later it got solved. I was able to delete. Something in drive thats y
@cameronmcnz
@cameronmcnz 10 ай бұрын
@@praveenb-xr Do me a favor and back up that drive before you lose everything!
@praveenb-xr
@praveenb-xr 10 ай бұрын
@@cameronmcnz Yeah I made for important files man. And the windows showed me som fix and error notifications then I hit repair and it repaired
@praveenb-xr
@praveenb-xr 10 ай бұрын
It took 30 minutes to repair the drive. Then fixed
@Gupatik
@Gupatik 2 ай бұрын
thx mate, i hate this git stuff, it deleted all my local files
@rakibhai4388
@rakibhai4388 Жыл бұрын
E you smart guy
@soumyamohanty8917
@soumyamohanty8917 10 ай бұрын
tys
@cameronmcnz
@cameronmcnz 10 ай бұрын
Glad I could help!
@brahmcdude685
@brahmcdude685 Жыл бұрын
you are amazing. but you enounce your S in a very loud whistle :(
@cameronmcnz
@cameronmcnz Жыл бұрын
Sorry about that. That's due to poor audio equipment. I upgraded my audio equipment for exactly that reason. My newer recordings aren't as bad. I'm always trying to do better!
@diegopallares7110
@diegopallares7110 Жыл бұрын
siuuu
Learn Git In 15 Minutes
15:59
Colt Steele
Рет қаралды 2 МЛН
Remove git tracking from Cloned Repository Folder or Directory
3:57
HAPPY BIRTHDAY @mozabrick 🎉 #cat #funny
00:36
SOFIADELMONSTRO
Рет қаралды 14 МЛН
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 151 МЛН
Heartwarming moment as priest rescues ceremony with kindness #shorts
00:33
Fabiosa Best Lifehacks
Рет қаралды 11 МЛН
How to delete a file from a Git repo
3:52
Cameron McKenzie
Рет қаралды 42 М.
git rebase - Why, When & How to fix conflicts
9:45
Philomatics
Рет қаралды 32 М.
How to upload a project / folder to GitHub
9:14
Abstract programmer
Рет қаралды 69 М.
Git It? How to use Git and Github
12:19
Fireship
Рет қаралды 732 М.
Git Tutorial For Dummies
19:25
Nick White
Рет қаралды 1 МЛН
How to Ignore Git Folders and Directories .gitignore
4:41
Cameron McKenzie
Рет қаралды 58 М.
How to Delete a Repository in Github
2:20
Azharul Rafy
Рет қаралды 318 М.
How Git Works: Explained in 4 Minutes
4:18
ByteByteGo
Рет қаралды 158 М.
Stow has forever changed the way I manage my dotfiles
8:09
Dreams of Autonomy
Рет қаралды 220 М.
HAPPY BIRTHDAY @mozabrick 🎉 #cat #funny
00:36
SOFIADELMONSTRO
Рет қаралды 14 МЛН