Git interactive rebase no commits to pick

前端 未结 4 1244
無奈伤痛
無奈伤痛 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:43

    As others have mentioned, you need to specify a commit range.

    git rebase -i 
    

    (Assuming that you are on the same branch as the commit to be edited)--

    To specify the commits, you can use the HEAD~5 shorthands or use sha checksum (which you can get by git log)

    In fact any commit will do if it is prior/ancestor to the commits which you want to delete/edit/reword in the tree. This will list all the commits since the in the editor(defined in your git config). From the list, to delete a commit, just delete that particular line, save and exit (vi habbits :) )the file+editor, and do git rebase --continue

    For the second answer, I agree with knittl

    have a branch with your changes (basically a configuration branch) and regularly merge the other branches into it. this way the changes will not move to other branches

提交回复
热议问题