Hacker News new | ask | show | jobs
by majikandy 829 days ago
This is word for word what I was about to write. Totally agree as I had a very puzzled face when that option didn’t appear in the list. And even more puzzled when (what I thought was the throwaway flippant idea of) ‘cloning the repo into another folder’ was in the list. I can safely say, I’ve never done this and can’t think of a scenario where I would need to.
1 comments

How is it different from the second bullet point? Except the second bullet point is more specific in that it says what to do with uncommitted changes.
>How is it different from the second bullet point?

How "cloning the repo on a different folder on the same machine just to work on a bug fix" is different from the main way Git is supposed to be used (creating a new branch for the bug fix and working there, then checking out your feature branch again)?

In that it doesn't make sense.

They might as well go full 1980s style "codebase_1/ codebase_2/ codebase_3/ codebase_3.bak/" and so on copies, and skip code management altogether...

That's the third bullet point. I was talking about this one:

> You can stash everything, create a new branch, switch to it, fix the bug, commit and push it, then switch back to what you were working on.

OP said this (you and a few others reiterated or agreed with it)

> Why couldn't you, like, create another branch off of main, switch to that, and fix the bug there, then resume working on your feature branch?

I can't see the difference. Seeing them side by side they're virtually identical except the blog author specified stashing!