Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move unpublished commits on master to new branch #1021

Closed
saraford opened this issue Mar 8, 2017 · 6 comments
Closed

Move unpublished commits on master to new branch #1021

saraford opened this issue Mar 8, 2017 · 6 comments

Comments

@saraford
Copy link

saraford commented Mar 8, 2017

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.

@saraford
Copy link
Author

saraford commented Mar 9, 2017

@niik
Copy link
Member

niik commented Mar 10, 2017

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.

@shiftkey shiftkey changed the title Add a button for the scenario "ARGH I forgot to create a branch first!! :sobs:" New Branch, maybe? Feb 28, 2018
@shiftkey shiftkey changed the title New Branch, maybe? "New Branch, maybe?" scenario when committing to master Feb 28, 2018
@shiftkey shiftkey changed the title "New Branch, maybe?" scenario when committing to master Move unpublished commits on master to new branch Feb 28, 2018
@shiftkey
Copy link
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.

@billygriffin
Copy link
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

@billygriffin
Copy link
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.

@billygriffin
Copy link
Contributor

Closing this issue in favor of #7023.

ahmetsait pushed a commit to ahmetsait/github-desktop that referenced this issue Apr 12, 2024
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants