• lemmyvore@feddit.nl
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    7 months ago

    Because you’d have to stash your modifications to be able to switch branch. The stash is a stack so very limited in what it can do (just push and pop). You might prefer to commit on a temporary branch instead. But you might also need some parts from your current modifications for the bug fix, at which point having it taken away on another branch or in stash won’t do. I would usually end up resorting to doing another checkout side by side anyway, and if I can make it a sparse checkout it’s even better.

    • lysdexic@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      7 months ago

      Because you’d have to stash your modifications to be able to switch branch.

      OP said nothing about stashing, only committing WIP commits to feature branches. I don’t think none of your remarks apply, because if you really need stuff from the WIP commits you can also cherry-pick them or checkout specific files.

      • lemmyvore@feddit.nl
        link
        fedilink
        English
        arrow-up
        1
        ·
        7 months ago

        If you find it more comfortable to keep swapping checkouts in the same dir that’s cool. I’m just explaining that some of use find it easier to keep several different checkouts around, and sparse checkouts are helpful when you do that.