Deleting commits | How, why and why not | GitHub Tutorial

preview_player
Показать описание
Made a mistake and want to undo or hide it from GitHub? Well, it's not the best to delete commits, but here's a step-by-step guide on how to do it. The video also touches on the only true ways to delete commits, and why you may or may not want to attempt to do so. By the end, you should have a better idea of how to delete commits, and why.

1. git reset --soft HEAD~1
2. git push origin +main --force

Timestamps:
0:00 - Explanation
0:17 - Why?
0:44 - Creating commits to delete
1:51 - Deleting commits from GitHub
3:29 - Why you DON'T want to delete commits

#GitHub #Delete #Commit
-----------------------------
-----------------------------

Everything in this video is my personal opinion and experience, and should not be considered professional advice. Always do your own research and make sure what you're doing is safe.
Рекомендации по теме
Комментарии
Автор

I messed up with my git structure and I had a lot of unnecessary commits that I reverted and my git was looking very congusted, but now it looks clean. Thank you for the video.

akshayshinde
Автор

life saver man, you explained everything perfectly and didnt rush things.

thescarecrow
Автор

You are a goddamn genius! Been trying to revert changes, delete history, and delete the branch for 3 THANK YOU!

nEpBePeH
Автор

This video was very helpful it is exactly what i was looking for. Thanks

souravraj
Автор

This video deserves more likes and views!!
Thanks for your valuable help! :)

juanpazmino
Автор

Thank you for such a straight forward and clear answer on this!

ChristopherJohnson-stfn
Автор

How to get back those 11 commits in the commit history after the force push. Please help me ASAP.

nanishiva
Автор

This saved a ton of time. Thanks so much!

XunoHa
Автор

What if I am simply running out of storage space and some unnecessary older versions are using that up? Working with large GameDev files for instance.

thevfxwizard
Автор

Thank you so much i was looking for this, finally something that works!!!😀😀😀

vodafone
Автор

Whoever disliked this video, is clearly on drugs! This video is great! Good Job Man! Been a subscibed for a while

AblazeCore
Автор

I can't delete the very 1st commit out of the GitHub repository right ? With git reset command As git reset just takes the head to the provided commit ID but how can I empty a GitHub repository with 0 commits like a fresh repository when it was created.?? Now I know the easy method for this is deleting and creating altogether a new repository but still asking for knowledge 😅

sureshmakwana
Автор

Hello! I have a problem with this command. Git prints this instead of deleting commits of the repository: `fatal: ambiguous argument 'HEAD~7': unknown revision or path not in the working tree.`. Searched this problem on stackoverflow, but it doesn't seem that anyone had this problem yet(

dayls
Автор

thanks a lot man this video saved me. 🤝

dev_troy
Автор

This video is about the ones at the end, what about a commit from the middle?

expertreviews
Автор

Very easy to understand video, thanks for the tip

antonioamandio
Автор

Thanks!
I by mistake left a Token there, even after regenerating it I wanted it gone

-kaito
Автор

this video was very helpful uwu thank u💕

magicalmonke
Автор

Thank you very much, that helped me a lot.

kirolosmalak
Автор

Thanks for this video very simple.. more videos...

aldonprincevelasco