Merge, update, and pull Git branches without using checkouts

前端 未结 17 1386
臣服心动
臣服心动 2020-11-22 07:42

I work on a project that has 2 branches, A and B. I typically work on branch A, and merge stuff from branch B. For the merging, I would typically do:

git mer         


        
17条回答
  •  清酒与你
    2020-11-22 08:21

    Another, admittedly pretty brute way is to just re-create the branch:

    git fetch remote
    git branch -f localbranch remote/remotebranch
    

    This throws away the local outdated branch and re-creates one with the same name, so use with care ...

提交回复
热议问题