git command to emit name of remote tracking branch

前端 未结 4 1037
无人共我
无人共我 2020-12-31 01:04

I\'d like a command that emits the name of the tracked branch for the branch I\'m on. Something like:

$ git checkout --track -b topic origin/master
Branch t         


        
4条回答
  •  星月不相逢
    2020-12-31 01:47

    As of git 1.8.3 you can now do this:

    git branch -vv 
    

    Very convenient as it shows the tracking branch for all local branches at once, but it is not suitable for scripting.

提交回复
热议问题