On Wed, 14 Sep 2016 10:33:24 -0700
Michael <keybou...@gmail.com> wrote:

> So I really don't understand the command line for rebase.
> What I have: My last two commits on master should have either been on
> develop, or on a branch off develop.

So, that's the case for cherry pick, not rebasing:

  $ git checkout develop
  $ git cherry-pick master~1 master

You can then reset "master" to where it should be:

  $ git push . master~2:master

so it will have two most recent commits less.

Note that if "develop" and "master" before those two commits point to
exactly the same commit (i.e. they were the same before you recorded
your two commits on a wrong branch) you can do even simpler: merely
rename "master" to "develop" and then re-create "master" to point to a
grandparent commit, like this:

  $ git checkout master
  $ git branch -M develop    # master is now gone, renamed to develop
  $ git branch master HEAD~2 # master is back

Remember that branches in Git are mere pointers, so they can easily be
repositioned, and they can come and go anytime.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to