gpt4 book ai didi

git - 如何仅在我的本地分支机构上使用 "git log --graph --oneline --all"?

转载 作者:IT王子 更新时间:2023-10-29 01:22:00 26 4
gpt4 key购买 nike

我想查看我所有的本地分支,但没有像 origin/master 这样的远程跟踪引用

这个命令向我显示了一个漂亮的图表,上面装饰了我所有的本地和远程跟踪分支:

git log --oneline --graph --decorate --all

我应该在此命令中添加/删除什么标志以仅显示本地分支?

最佳答案

这将显示所有本地分支机构。

git log --graph --oneline --branches

来自 git log --help

--branches[=<pattern>]
Pretend as if all the refs in refs/heads are listed on the command line as <commit>.
If <pattern> is given, limit branches to ones matching given shell glob.
If pattern lacks ?, *, or [, /* at the end is implied.

所以 --branches 就足够了。我喜欢添加 --decorate 并给整个命令一个简短的别名。

关于git - 如何仅在我的本地分支机构上使用 "git log --graph --oneline --all"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12177576/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com