CodeNewbie Community 🌱

Discussion on: #CNC2021 "Write More" Mission 2 [pt. I] Submission Thread

Collapse
 
gaurang847 profile image
Gaurang • Edited on

Here are my three writing ideas:

  1. Explainer: How I used cherry-pick to solve a Git issue with Forking workflow

    Something that I recently worked on. I want to write it down so that it could be useful to others.

  2. Explainer: What are Node.js Streams?

    I feel Node.js streams are something people rarely talk about. And it's a mystery for most. I want to share whatever information I have gained about them.

  3. Project: Integrating a payment-gateway in an e-commerce website (Focus on Backend part)

    For a long time, I've worked with payment gateways. I want to create a project that people can used as a reference by people who might be new to e-commerce.

I'm going forward with idea #1

  1. Because the problem is fresh in my mind. And I want to write on it quickly.
  2. It's the only one that I feel I'll be able to finish in time. After writing the outline for the other two, I felt they'll require considerable time and effort. So I'll work on them on the sides. But for this challenge, my focus will be on idea #1

Here's the link to my unpublished post outline.
community.codenewbie.org/gaurang84...

Collapse
 
lyqht profile image
Estee Tey

Hey there! I can't seem to access your unpublished post!

Collapse
 
gaurang847 profile image
Gaurang

Woops! I guess you can't use liquid tag to embed an unpublished post. ^^'

Thread Thread
 
lyqht profile image
Estee Tey

Alrighty! Able to access it now :D

I'm not sure what do you mean by "Take backup clone first" 🤔

Thread Thread
 
gaurang847 profile image
Gaurang

It's my personal safety measure when dealing with these kinds of things.
When you're trying to solve a Git issue, you often need to revert certain commits, reapply them, merge and rebase branches, etc. right?
You're essentially re-writing (Git) history.
If you're not careful, you could lose important parts of your code. And if you push it to the origin without realizing what you've done, you're in developer hell. RIP.

To avoid that, this is what I generally do. If I feel unclear about how to solve a problem, I clone the repo again in another directory and checkout the branches that I'm gonna touch on.
This is the backup clone.

If things go south and I lose some code. Or I somehow mess up the history more than it already was. I can just scrape the existing local repo and start using the backup clone.
Now if I'm having one of my worse days. And I force-push my changes to the origin without realizing that I've made a blunder.
I can just go to my backup clone and run git push --force origin master.

It's basically like a save-point before the boss battle.

Thread Thread
 
lyqht profile image
Estee Tey

ohh, now i understand what you mean by "backup clone"! I also like your analogy of "save-point before the boss battle", you could include that in your article :P

I do that sometimes as well when it comes to complicated merge/rebase xD

A trick that my friend taught me recently was to just remove the branch that has problems entirely from your local machine and then git pull to get that branch completely fresh from remote - but of course this trick only applies if the problem is only for that branch and that you don't need any local changes on that anymore.

Looking forward to your cherry picking article! Haven't tried it before.

Thread Thread
 
gaurang847 profile image
Gaurang

Oh! Imma include the whole comment in my post! 😆

A trick that my friend taught me recently was to just remove the branch that has problems entirely from your local machine and then git pull to get that branch completely fresh from remote - but of course this trick only applies if the problem is only for that branch and that you don't need any local changes on that anymore.

Ah yes! That's a good one.

Looking forward to your cherry-picking article! Haven't tried it before.

Thanks, man! 😌
The deployment practice at my work is such that I often have to cherry-pick commits for a release 😅
I hope you'll like the article. Would you be interested to review a more mature draft once it's ready?

Thread Thread
 
lyqht profile image
Estee Tey

sure of course! 😄

Collapse
 
vpugh profile image
Tori Pugh

Short and sweet. I think when it gets fleshed out I can see an extremely helpful article. I need this article awhile ago when I had to cherry pick for the first time.

Collapse
 
gaurang847 profile image
Gaurang

Haha, I'm convinced. We just don't talk enough about Git!
Even though it's literally a lifeline for developers.

Btw there's still a lot of time. But would you be interested in reading a more mature draft once it is ready? 😄

Thread Thread
 
vpugh profile image
Tori Pugh

Sure! I'd love to.

Haha, we don't talk about Git enough so I'm all for learning more.