我该如何让git向我展示哪些分支正在跟踪什么? [英] how do I get git to show me which branches are tracking what?

查看:110
本文介绍了我该如何让git向我展示哪些分支正在跟踪什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以做 git branch --all ,它向我展示了本地和远程分支,但是它并没有用于向我展示它们之间的关系。 / p>

如何以显示哪个本地分支正在跟踪哪个远程的方式列出分支?

解决方案

非常多的瓷器命令,如果您希望用于脚本编写,那么效果并不理想:

  git branch -vv #双重冗长! 

请注意,在git 1.8.3中,上游分支以蓝色(参见这个分支在git中跟踪(如果有的话)是什么?






如果您想要清洁输出,请参阅 arcresu的答案 - 它使用了一个瓷器命令,我不认为在我最初编写这个答案时存在这个命令,所以它更简洁一些,并且为配置了分支的分支而不仅仅是合并。


I know I can do git branch --all and that shows me both local and remote branches, but it's not that useful in showing me the relationships between them.

How do I list branches in a way that shows which local branch is tracking which remote?

解决方案

Very much a porcelain command, not good if you want this for scripting:

git branch -vv   # doubly verbose!

Note that with git 1.8.3, that upstream branch is displayed in blue (see "What is this branch tracking (if anything) in git?")


If you want clean output, see arcresu's answer - it uses a porcelain command that I don't believe existed at the time I originally wrote this answer, so it's a bit more concise and works with branches configured for rebase, not just merge.

这篇关于我该如何让git向我展示哪些分支正在跟踪什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆