DEV Community

Thibaut Andrieu
Thibaut Andrieu

Posted on

Tiny Tips : gitk -- (with 2 dash)

When I want to view the history of a file, I use gitk, start typing a few letters, hit tab, type again, hit tab, etc… to autocomplete the full path:

gitk src/com<tab>ponent/data<tab>base/dba<tab>ccess.py
Enter fullscreen mode Exit fullscreen mode

However, when hitting tab, gitk may hang a few seconds, especially on huge repositories. It's because he tries to autocomplete a branch name in addition to local files.

By adding --:

gitk -- srs/com<tab>...
Enter fullscreen mode Exit fullscreen mode

Autocompletion will only complete local files, making it much more reactive.

Note:
In this case, -- is not a gitk feature, but a shell feature.

Top comments (0)