How to know if there is a git rebase in progress?

后端 未结 7 516
说谎
说谎 2020-12-02 18:02

When I start a git rebase -i, I can issue commands like git rebase --continue, or git rebase --abort. Those commands only work if a re

7条回答
  •  伪装坚强ぢ
    2020-12-02 18:30

    I have not seen it stated clearly, so here it is:

    during rebasing process, if there is one under way, git status is now sufficient, as it gives information (for reference, I head smaple branches named master and rbBr):

    interactive rebase in progress; onto 5f8e534
    Last command done (1 command done):
       pick 1b7a450 BRANCH: another comment
    No commands remaining.
    You are currently rebasing branch 'rbBr' on '5f8e534'.
      (fix conflicts and then run "git rebase --continue")
      (use "git rebase --skip" to skip this patch)
      (use "git rebase --abort" to check out the original branch)
    
    Unmerged paths:
      (use "git restore --staged ..." to unstage)
      (use "git add ..." to mark resolution)
            both modified:   User.java
    
    no changes added to commit (use "git add" and/or "git commit -a")
    

    This is shown before resolving conflicts, after resolving conflicts it shows:

    interactive rebase in progress; onto 5f8e534
    Last command done (1 command done):
       pick 1b7a450 BRANCH: another comment
    No commands remaining.
    You are currently rebasing branch 'rbBr' on '5f8e534'.
      (all conflicts fixed: run "git rebase --continue")
    
    Changes to be committed:
      (use "git restore --staged ..." to unstage)
            modified:   User.java
    
    PS C:\my_git_repos\learning_git> git rebase --continue                                                                                                                                                                                       [detached HEAD 9645135] BRANCH: another comment
     1 file changed, 1 insertion(+)
    Successfully rebased and updated refs/heads/rbBr.
    

提交回复
热议问题