Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitk display only specified branches

Tags:

I want to compare 2 branches using gitk, without the clutter of other branch histories.
I can achieve this via the gui: View > New view > Branches & tags: v0.8.x v0.9.x
I tried the following, but it still shows all branches: gitk --branches v0.8.x v0.9.x
What is the correct syntax?

like image 755
robC Avatar asked Jun 02 '14 10:06

robC


People also ask

What does gitk command do?

Gitk is a graphical repository browser. It was the first of its kind. It can be thought of as a GUI wrapper for git log . It is useful for exploring and visualizing the history of a repository.

What is gitk written in?

Gitk was the first graphical repository browser. It's written in tcl/tk. gitk is actually maintained as an independent project, but stable versions are distributed as part of the Git suite for the convenience of end users.

What does git branch command do?

The git branch command lets you create, list, rename, and delete branches. It doesn't let you switch between branches or put a forked history back together again. For this reason, git branch is tightly integrated with the git checkout and git merge commands.

How do you compare two branches?

In order to compare two branches easily, you have to use the “git diff” command and provide the branch names separated by dots. Using this command, Git will compare the tip of both branches (also called the HEAD) and display a “diff” recap that you can use to see modifications.


1 Answers

gitk v0.8.x v0.9.x does it for me.

However, a closer look on the displayed branches shows me that there are actually not the given branches displayed. In addition, all branches that point to a commit in the history of the two branches are also shown.

So, the command displays all branches that are specified including those branches that are direct ancestors of the ones specified.


Edit:

The --branches= switch would be used if you want to see all branches that are, for example, named fix/*:

gitk --branches=fix/* 

would show you all branches that are matching the given shell glob.

See also the docs of gitk for a deeper explanation.

like image 188
eckes Avatar answered Oct 10 '22 21:10

eckes