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

标签 git

我想查看我所有的本地分支,但没有像 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/

相关文章:

git - merge 冲突后在相同的更改 ID 下推送

git - 如何配置 'git log'显示 'commit date'

git - 稀疏 checkout 给我一个错误 stderr : fatal: Not a valid object name HEAD

git - 选择要与 Git 一起使用的私钥

git - 如何将 git repo 添加到项目的工作目录

git - Git存储库维护和审核工具

git - 如何 merge 来自其他 git 存储库的部分更改

git - 如何在 git 的 BASH shell 中更改我的默认浏览器?

git - 在 Azure yaml 管道内设置 git 凭据

android - 将Android Studio项目导出到GIT