How to change the starting point of a branch?

前端 未结 3 1396
-上瘾入骨i
-上瘾入骨i 2021-02-01 19:13

Usually I create a branch by running a command like git checkout -b [branch-name] [starting-branch]. In one case, I forgot to include the starting-branch

3条回答
  •  一生所求
    2021-02-01 19:29

    You want the branch to point to a different commit. You can do that by running

    git branch -f  
    

    Note that if branch-name is the current branch, you have to switch to a different branch first, for example with git checkout master.

提交回复
热议问题