简体   繁体   中英

git - which remote branch is my local branch based on

I have seen few posts saying that running

git branch -lvv

will show all your local branches and beside them, the remote branches your local branches are based on. But I do not see that happening.

I am using git version 2.7.1.windows.2:

me@ME-PC BLAH64 /c/code/myproj (BRANCH-10)
$ git --version
git version 2.7.1.windows.2

And here is what I get when I issue:

me@ME-PC BLAH64 /c/code/myproj (BRANCH-10)
$ git branch -lvv
* BRANCH-10        xxxxxxx some comment
  BRANCH-7         xxxxxxx some comment
  BRANCH-12        xxxxxxx some comment
  dev-branch       xxxxxxx [origin/master] some comment
  dev-branch-c     xxxxxxx some comment

xxxxxxx above are some strange looking numbers such as 05317bba or similar.

How do I see all mine local branches and the remote branches these local branches are based on? ie how do I know what remote branch is my local BRANCH-12 based on?

So, I am not looking for ALL branches but for my local branches and their respective remote branches.

for my repos, git branch -vv will output something like you said, but in some cases it will output:

$ git branch -lvv
  branch1      3d52a6d some commit message 1
  branch2      36c34dc some commit message 2
  master       f476f37 [origin/master] some commit message 3

this means branch1 and branch2 are not present in remote (in my case they have already been deleted through Bitbucket)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM