This is Billy.
He is a trainee developer working for an important company.
Unfortunately for the company, today Billy has woken up and...
For further actions, you may consider blocking this person and/or reporting abuse
Poor Trent should have been familiar with
git reflog
:) Nice article!Thank you so much!
Git reflog would have definetely saved the day here
This article is genius, sucked me in with entertainment and actually got me to read something and become informed, thankyou!
Let's goooo, glad it helped and you enjoyed it!
Adding lessons in with a sense of humor, I love it. π
Thanks Kenneth! The world needs fun git tutorials hahaha
It most definitely does my friend π
That was great, thanks for the laugh! Well written.
Thanks for the kind comment!
That's why everybody and their dog should not use plain
--force
because it may be destructive.Instead always use
git push --force-with-lease
(!)Found this little gem while watching "So You Think You Know Git - FOSDEM 2024" on YouTube, around 17:42. There is even part 2 of this video π
See:
Out of curiosity, is there a reason why they aren't flipped? Like why it wasn't designed with force being force with lease by default and the current force being a force without lease command?
So after a few google searches, I honestly couldn't find the answer! So I just went into the Git repository and went down to a tag made 20 years ago.
Here's the git push documentation from that moment:
github.com/git/git/blob/v0.99/Docu...
My guess is git push was made first and then somewhere down the line the option to push with lease was added later.
Thank you for mentioning it! The resources you posted are also excellent so it adds a lot.
Thanks to you and another commenter, I decided to at least mention it in the article.
If a previous commit is stable and you messed up things a lot (not necessary due to wrong git usage) then
git reset --hard <commit hash>
may be exactly what you needOh absolutely! There's a use case and everything for git reset. Especially when you know what you're doing. Git is super powerful for that reason.
Git push - -force also has its uses. It's necessary for doing a clean rebase or when you want to cleanly amend a commit.
It's all about responsible use.
This article was about irresponsible use π
The article is great! Just wanted to leave this one to make people curious. I also love converting on these kind of articles, finding gems I never heard/read before π
Congrats for this article. Pretty fun. In real conditions, sign your commits + protect main branches against forced push.
Pull requests can also mitigate those issues (which is mentioned in the post)
Creative way to provide some serious DON'Ts and why
Thank you for the kindness!
The best way to learn, doing wrong things.
There's no better way to learn π
Great article.
For reference, when a .env file is pushed to public GitHub, it is 54% likely to expose a secret (and it happens a lot..)
source: The State of Secrets Sprawl 2024
Awesome stat! Really liked the phrase:
βCompromised credentials are a gift that keeps on giving
(your stuff away)β
Fun article, if a little evil. One clarification: git reset alters the commit history in your local repository only. If it no longer matches the history on the remote, you will need to use a forced push; regular push will fail.
Oh shoot! You're totally right. You're the first person to bring that up π
I updated the line. Thanks for making Billy a better developer!
Now Billy can be the hero by using the distributed architecture and his newly-found git-fu to magically save everyone's work.
Perhaps he will also pin some bugs on Trent: github.com/jayphelps/git-blame-som...
This is MASTERFUL. I love how this project even exists.
And maybe! Now that he's gotten all that evil out of his system, maybe he can put out some good in the world.
Wild ride, Billy sure is a menace to the companyβ’.
Oh absolutely. Everybody should worry how he codes if this is his way of learning hahaha
Damn, tricked me into reading an article about git.
Also, I read this in the Stanley Parables narrators voice.
You know, it was kind of the vibe I was going for.
Plus that man's voice is smooth as butter so it only made the experience better
Muahahaha
Materpieceπ
Excellent article thanks for sharing
Thank you for reading
I really like your sense of humour...way of thinking is totally super ...looking forward to collaborate with you ...
Will take your help in furture definitely...really fan of your post ..looking forward for such a post
Really fan of your post
Billy as an agent of chaos was hilarious. Great article.
Super happy you enjoyed it!
lol. It was an amazing read.
Thank you!
This made me laugh big time, Billy knows always how to get things done, even getting fired haha! Good read and eye opener for every developer :D
Thank you!
I hope there were Cameras in place and evidence that shows Trent was just a bit careless and Billy was behind this.
I mean, if the company doesn't have basic permissions so nobody posts on Main, you think they care enough for cameras? π
All this time, this wasn't Billy's story, it was Trent's villian origin story
Trent gonna come back with a vengence and with the git reflog
This article is excellent! Thank you for the laughs and for reminding us of important work principles. I really enjoy learning from articles that incorporate humor. I'm eager for more laughs and learning. ;)
Aww thank you Levi! We'll see what else I have cooked up for in the future
This is best git tutorial i ever read.
Thank you my kind friend
Its a shame you didn't mention git push --force-with-lease which is the correct way to do git force pushes.
You are absolutely right. I added it as a sort of mention so others know it exists. Added it cause you and another commenter brought it up. Thank you
Disable send and merge in main branch, only permitted send for feature/Fix/others work branch. This resolve 80% issue problems. Merge only after receive 2 code reviews approved.
Yes, absolutely and completely agree!
Thanks for the laugh! It's giving me BOFH vibes!
(And I just found Enterprise Developer From Hell!)
I have never heard of BOFH! I looked over it a bit and yeah I can see it hahaha
Nice article. Thanks for sharing.
hahahah nice
enjoyed it till the last line, please keep writing "dumb" articles , it's educative and more important "not boring". and you are natural !
Aww thank you! I think silly is the better term here but I have been blown away by how much others have enjoyed it. Thanks again
Very funny!. We want more Billy stories
Maybe in the future π
hahaha...
Absolute god-tier article. This sets a new genre for dev.to
Love the humor. π
Thanks!
LOL, this is scaring me hahaha
It's the good kind of scared π
I feel more sorry for the on-call than for Trent!
awesome, humorous explanation!!
This is exactly why in our company I call for the enforcement of proper security measures in GitHub. Anyway, funny and true story bro! π
Absolutely!!! Always have good security measures.
And thank you for the comment π
hahaha, a git article i enjoyed reading for once
This was quite fun to read, yet educative as well. Thanks for sharing
Thank you for reading!
great article!
Thank you!!
Love it! It's not worth doing if you can't have some fun (okay, not that kind)!
Exaaaactly, you get it! hahaha
I learned a lot with fun and laugh. Thank you.
Thank you for reading!
Your article turned the complexity of git commands into a delightful learning experience. Kudos for making technical education so engaging!
Aww thank you Ozgur!
one of the best articles i read today, love it!!
Thanks a ton for the love! Appreciate it
Not all Billy's wear capes. Amazing article.
Thank you for the kindness π
Remote work would have prevented Billy from doing it all, just saying... =D
That is SUCH a good point though!!
Viva la revoluciΓ³n for remote work hahaha
The only thing Trent must do is set password for his laptop.
Google github prophecy?