This issue is a followup to a discussion on Mastodon: https://social.jvns.ca/@b0rk/115640363143354219 (started here: https://mathstodon.xyz/@ddrake/115633967836101201)
Copying my suggestion there:
These two prompts could be a bit more clear, and be improved to show exactly how they are related:
"I accidentally committed something to master that should have been on a brand new branch!"
and
"I accidentally committed to the wrong branch!"
For the first one, it mentions "master" but there's nothing special about accidentally committing to master/main; the workflow there works regardless of which branch you're on -- the only important thing is that you want the commit on a new branch.
The second one is identical to the first -- it doesn't matter which branch you start on -- with one difference: you want the commit on an existing branch.
Maybe the following would make the similarity clearer?
"I accidentally committed to the wrong branch, and want it on a new branch!"
and
"I accidentally committed to the wrong branch, and want it on an existing branch!"
Then make both solutions start with a commit to wrong-branch; in the first, you put that top commit on newly-created-branch, and in the second, you get it on existing-branch.
And for both, it seems like you should mention cherry-pick; that seems to be a bit more idiomatic and safer. (To me, at least...)
This issue is a followup to a discussion on Mastodon: https://social.jvns.ca/@b0rk/115640363143354219 (started here: https://mathstodon.xyz/@ddrake/115633967836101201)
Copying my suggestion there:
These two prompts could be a bit more clear, and be improved to show exactly how they are related:
and
For the first one, it mentions "master" but there's nothing special about accidentally committing to master/main; the workflow there works regardless of which branch you're on -- the only important thing is that you want the commit on a new branch.
The second one is identical to the first -- it doesn't matter which branch you start on -- with one difference: you want the commit on an existing branch.
Maybe the following would make the similarity clearer?
and
Then make both solutions start with a commit to
wrong-branch; in the first, you put that top commit onnewly-created-branch, and in the second, you get it onexisting-branch.And for both, it seems like you should mention cherry-pick; that seems to be a bit more idiomatic and safer. (To me, at least...)