Add second command to checkout an existing branch

Created on 22 October 2024, 4 months ago

Problem/Motivation

When working on multiple issues you will switch branches several times.
When you have a pre-existing branch you either have to copy the checkout command then delete the track and -b option, or remember the issue id.

It would be great to have a second option for checking out a branch that you already have.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

3.0

Component

User interface

Created by

🇺🇸United States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @nicxvan
  • First commit to issue fork.
  • 🇺🇸United States nicxvan

    Added a suggestion, I'm not sure if that is better or not if I'm being honest.

  • 🇺🇸United States drumm NY, US

    Where this gets tricky is you probably want to fetch changes. How you do that depends on what you have locally, what is upstream, and the preferred Git workflow for the project. We don’t want to get into providing suggestions for every situation, that is for documentation and learning Git. I think the most I’d want to suggest is git fetch {issue fork remote}. Anything additional would become too much UI trying to fit in a small space - the next step might be git reset … if I know I don’t have anything local, git rebase … if I do have local changes, or git merge … if that’s better for a specific project or situation. Maybe we’d want to add a note about remembering to get upstream changes into your local branch.

    For me, since the command is simply git checkout {branch}, I always type it out using shell tab-completion or copying the branch name from the issue or MR page.

  • 🇺🇸United States nicxvan

    Honestly I think just checkout is enough.

    Maybe a warning to follow other recommended steps, but as you said it's workflow specific.

  • Pipeline finished with Skipped
    9 days ago
    #415208
    • drumm committed 84d6bb95 on 7.x-3.x authored by b_man
      Issue #3482562 by b_man, drumm, nicxvan: Add second command to checkout...
  • 🇺🇸United States drumm NY, US

    This is deployed now

  • 🇺🇸United States nicxvan
Production build 0.71.5 2024