How do I list all remote branches in Git 1.7+?

后端 未结 19 2274
轮回少年
轮回少年 2020-12-02 03:14

I\'ve tried git branch -r, but that only lists remote branches that I\'ve tracked locally. How do I find the list of those that I haven\'t? (It doesn\'t matter

19条回答
  •  借酒劲吻你
    2020-12-02 03:55

    remote show shows all the branches on the remote, including those that are not tracked locally and even those that have not yet been fetched.

    git remote show 
    

    It also tries to show the status of the branches relative to your local repository:

    > git remote show origin
    * remote origin
      Fetch URL: C:/git/.\remote_repo.git
      Push  URL: C:/git/.\remote_repo.git
      HEAD branch: master
      Remote branches:
        branch_that_is_not_even_fetched new (next fetch will store in remotes/origin)
        branch_that_is_not_tracked      tracked
        branch_that_is_tracked          tracked
        master                          tracked
      Local branches configured for 'git pull':
        branch_that_is_tracked merges with remote branch_that_is_tracked
        master                 merges with remote master
      Local refs configured for 'git push':
        branch_that_is_tracked pushes to branch_that_is_tracked (fast-forwardable)
        master                 pushes to master                 (up to date)
    

提交回复
热议问题