gitrefprefetchgitk

What are these prefetch refs and how do I get rid of them?


I have been using gitk for years. Today I noticed that there are a bunch of new refs in my repo. See screenshot below.

enter image description here

The ref is prefetch/remotes/origin/<branch>, and there is one like this for every branch.

  1. What are these?
  2. Why are they only showing up now?
  3. How do I get rid of them?

Solution

    1. They are refs used internally by Git since version 2.42 that exist to optimize performance.

    2. Git was updated on the remote.

    3. The new version of gitk included with Git 2.51.0 allows hiding these.

    Go to Edit -> Preferences, and in the "Refs to hide" box enter prefetch/*.

    To install the latest version of Git, you can use the PPA.

    sudo apt-get install software-properties-common
    sudo apt-add-repository ppa:git-core/ppa
    sudo apt-get update
    sudo apt-get install git