Git interactive rebase no commits to pick

前端 未结 4 1245
無奈伤痛
無奈伤痛 2021-01-30 07:44

I\'m on master and I did rebase -i

Got this:

noop

# Rebase c947bec..7e259d3 onto c947bec
#
# Commands:
#  p, pick = use c         


        
4条回答
  •  借酒劲吻你
    2021-01-30 08:30

    Like a non-interactive rebase, you have to rebase onto a particular commit.

    With a non-interactive rebase, if you supply a direct ancestor of the current commit then you aren't changing anything; with an interactive rebase you can edit commits after the commit that you are rebasing onto, even if the commit is a direct ancestor of your current commit but you do have to specify this commit that you want to edit onwards from.

    I don't know the details of your situation but you might want something like this:

    # Opportunity to edit or prune commits between origin/master and current branch
    git rebase -i origin/master
    

    or

    # Edit some of the last ten commits
    git rebase -i HEAD~10 # Note that ~10 uses a tilde("~") not a dash("-"_) !
    

提交回复
热议问题