I find cherry-picking to be easier in this case. Just checkout the branch and cherry pick commits from 'wrong' branch.
Oh shit, git: Getting myself out of bad situations
11–20 of 520 posts
Re: Oh shit, git: Getting myself out of bad situations
#12Is it just me or did http://ohshitgit.com/#accidental-commit-master forget to checkout master before calling reset?
Re: Oh shit, git: Getting myself out of bad situations
#13Shouldn't it be easy for Git to remove objects created after a given time, and then remove all objects that refer to those objects iteratively?
Re: Oh shit, git: Getting myself out of bad situations
#14Is it just me or did http://ohshitgit.com/#accidental-commit-master forget to checkout master before calling reset?
(Which is why I've almost exclusively switched to `git checkout -b ` for creating. How often do I want to create but not switch to the branch?)
Re: Oh shit, git: Getting myself out of bad situations
#15If this is a guide for beginners, there should be (more?) warnings not to do history rewriting operations on commits that have already pushed.
From the disclaimer at the bottom: > This site is not intended to be an exhaustive reference, nor is it a beginner's tutorial.
Re: Oh shit, git: Getting myself out of bad situations
#16Re: Oh shit, git: Getting myself out of bad situations
#17If this is a guide for beginners, there should be (more?) warnings not to do history rewriting operations on commits that have already pushed.
Why is recovering from an upstream rebase considered more problematic than recovering from merge conflicts?
Re: Oh shit, git: Getting myself out of bad situations
#18Is it just me or did http://ohshitgit.com/#accidental-commit-master forget to checkout master before calling reset?
Creating a branch doesn't check it out by default. To do both at once, it's either "checkout -b" or "branch -c", I forget which because it's "b c" in Magit.
Re: Oh shit, git: Getting myself out of bad situations
#19Is it just me or did http://ohshitgit.com/#accidental-commit-master forget to checkout master before calling reset?
It's still on master because `git branch` just creates and doesn't do checkout. (Which is why I've almost exclusively switched to `git checkout -b ` for creating. How often do I want to create but not switch to the branch?)