Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Depends on the codebase perhaps. I sometimes touch parts which are not directly relevant to the the task e.g. mostly a minor reactor, a minor bug fix etc. It's nice to leave a trail on that particular change that it was just a refactor instead of exploring whole changeset only to find out that this change was irrelevant.


I've found worktrees[1] are a great tool for this use case.

"oh. i should fix this, but it doesn't have anything to do with what i'm currently solving." cd ../worktree-checkout, make a branch, do the fix, push, open a pr. then cd ../original-checkout and continue on. rebasing the fix into my wip when the PR is merged (or cherry-pick if you're confident) as needed.

1. https://git-scm.com/docs/git-worktree




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: