How to know what branch I am on git when checkout origin/

前端 未结 3 1605
醉话见心
醉话见心 2021-01-27 19:33

We have a script that actually does git fetch; git checkout origin/ to deploy a certain feature. The reason why we do this is that we wan\'t to avoid

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-27 20:08

    git symbolic-ref --short HEAD should tell you what branch you are on, or print an error if you are not on a branch.

提交回复
热议问题