Skip to content

Move unpublished commits on master to new branch #1021

Closed

Description

@saraford

I cannot remember to create a branch first before I start making commits on master. I'll get halfway through whatever edits and I'm like "d'oh! I forgot a branch" so I can either try to remember my cheatsheet list of git commands to get my changes back to a branch, or what I honestly do is ctrl-c, ctrl-v, do a reset --hard, and then (if I'm lucky) create the branch, and then put my changes back.

What I want is something that will take whatever commits I have locally and move those commits to a new branch and leave the remote untouched.

Activity

  1. niik commented on Mar 10, 2017

    @niik
    Member

    We've discussed various ways of addressing this in the past and I think it's a really interesting area for improvement.

    I think at the very least we should show a warning when committing straight to master with the option of creating a branch. We've also discussed supporting the scenario you describe of being able to bring commits out of master and resetting it to the origin branch. That path has a whole lot of edge-cases though so I'd really prefer it if we could prevent these "accidents" from happening in the first place.

    That said I think we're pretty full for beta and possibly 1.0 as well but this is a great feature that I want for us to get in at some point.

  2. changed the title [-]Add a button for the scenario "ARGH I forgot to create a branch first!! :sobs:"[/-] [+]New Branch, maybe?[/+] on Feb 28, 2018
  3. changed the title [-]New Branch, maybe?[/-] [+]"New Branch, maybe?" scenario when committing to master[/+] on Feb 28, 2018
  4. changed the title [-]"New Branch, maybe?" scenario when committing to master[/-] [+]Move unpublished commits on master to new branch[/+] on Feb 28, 2018
  5. shiftkey commented on Feb 28, 2018

    @shiftkey
    Member

    I still want to call this feature "New Branch, Maybe?" and ensure it's pronounced like "Call Me, Maybe?", but this came up at our mini-summit and is an idea we want to revisit. Stay tuned for more details.

  6. billygriffin commented on Sep 28, 2018

    @billygriffin
    Contributor

    From @nerdneha in #4647:

    As a user, before I accidentally made a bunch of commits on the wrong branch (ex: protected or master), I want the app to warn me and guide my commits to a new branch so that I don't have to use command line magic to get them to a new branch or reset my work and risk losing everything.

    Just want to call out that there are a couple use cases here to potentially differentiate:

    1. Master branch -> new branch
    2. Protected branch -> unprotected branch
  7. billygriffin commented on Feb 11, 2019

    @billygriffin
    Contributor

    I'm going to roll #3633 into this issue, as I think there's an opportunity to take a more holistic look at branch protections and understanding people's workflows there.

  8. billygriffin commented on Mar 6, 2019

    @billygriffin
    Contributor

    Closing this issue in favor of #7023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions