Is there any way to exclude branches from showing in GitK?

NotACleverMan

Sometimes when I use GitK there's a load of commits on branches I'm not concerned with and they tend get in the way of what I'm doing.

It would be nice to be able to specify which branches I want, or specify which branches I want to exclude.

Is this possible?

Thomas Kelley

You can specify which branches you want by specifying them as arguments to the gitk command. I'm assuming that you're already using --all, but you might be interested to know that there's also a --not flag...although it has some side effects and is not too useful in most circumstances.

Consider a repository that looks like this:

git checkout feature-B
gitk --all

enter image description here

If you specify no arguments, you get just the branch you're on:

gitk

enter image description here

If you specify multiple branches, you get those branches, and the branches that are fully merged (i.e. they don't "stick out"). For example, here I have feature-B, feature-C, along with the fully merged feature-A and master, but no feature-D:

gitk feature-B feature-C

enter image description here

Finally, you can use the --not flag to ignore a branch. However, since a branch refers to all the commits that lead up to it, the --not flag will ignore commits that are on the branches that you do specify.

gitk feature-B --not feature-D
gitk --all --not feature-D feature-C

Both of these will give you:

enter image description here

Here, the commits Initial commit and 1 are ignored, because they belonged to branch feature-D. Commit 2 is also ignored for the same reason, but is shown as an empty commit, since it would be incorrect and misleading to show commit 3 as the initial commit in the branch. This flag can be helpful sometimes, but I don't usually find myself using it.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Is there any way to drag and drop from a treeview to canvas in tkinter?

来自分类Dev

Is there any way to get all sub directories from a given path?

来自分类Dev

Any way to interpret pstree?

来自分类Dev

Are there any best practices using Doctrine 2 migrations on different GIT branches?

来自分类Dev

I am using okhttp in my android application. Is there any way to prevent duplicate requests from getting executed?

来自分类Dev

Why search query not showing any result in PHRETS?

来自分类Dev

在gitk上保存视图

来自分类Dev

gitk:找不到命令

来自分类Dev

启动gitk时出错

来自分类Dev

裸目录上的gitk

来自分类Dev

启动gitk时出错

来自分类Dev

Is there any way to avoid sub queries?

来自分类Dev

Any way to parse Less in .net?

来自分类Dev

Is there any way to install a transient package?

来自分类Dev

How to exclude links from .click handle

来自分类Dev

Exclude files from Play framework production build

来自分类Dev

Exclude a column from a select using LINQ

来自分类Dev

Exclude Subfolders from Rewrite rule htaccess

来自分类Dev

Regex match but exclude character from capture group

来自分类Dev

OpenEJB: How to exclude jar from module search?

来自分类Dev

Bitbake了解EXCLUDE_FROM_WORLD机制

来自分类Dev

tar“ --exclude-from”双星通配符

来自分类Dev

Most efficient way to exclude indexed rows in pandas dataframe

来自分类Dev

Any possible way to get the value from form1 to form2 before submitting form2

来自分类Dev

Is there any way to add color to cell from hex value like '#72fe9c' in my excel doc using NPOI

来自分类Dev

如何更改gitk的UI颜色?

来自分类Dev

强大的gitk / gitg替代方案?

来自分类Dev

gitk只显示指定的分支

来自分类Dev

gitk等效于atlassian隐藏

Related 相关文章

热门标签

归档