How to check if remote branch exists on a given remote repository?

后端 未结 14 999
独厮守ぢ
独厮守ぢ 2020-12-02 11:04

I need to do a subtree merge for a specific branch, if it exists on a given remote repository. The problem is that the remote repository is not checked out locally, so I can

14条回答
  •  失恋的感觉
    2020-12-02 11:35

    Another way you can use in the current folder if it is a git repo to run

    git branch -a | egrep 'remotes/origin/${YOUR_BRANCH_NAME}$'
    

提交回复
热议问题