Lawrence Choy
Lawrence Choy

Reputation: 6108

Intellij IDEA clear git repository URL history

I am using Intellij IDEA 14.1.4.

I have checked out a few projects using Git before. Now whenever I go click VCS-> Checkout from Version Control -> Git, I can see my checkout history with full URL listed inside Git Repository URL. Some of them are really old projects and I want to get rid of them.

How can I clear the list saved inside Git Repository URL?

Upvotes: 2

Views: 2163

Answers (2)

Luca Oddone
Luca Oddone

Reputation: 61

This question seems a little bit old, anyway I would like to share the solution for the same problem I had to put in place on my machine, maybe it will come in handy for someone else in the future :)
On my machine, runnig Windows (Edition:Windows 10 Pro Version:21H2 OS build:19044.1826) on which IntelliJ IDEA 2021.2.2 (Community Edition) is installed (Build #IC-212.5284.40, built on September 14, 2021), I had to edit the file living in the following directory: C:\Users\USERNAME\AppData\Roaming\JetBrains\<product><version>[in my case: IdeaIC2021.2]\options\vcs.xml. Actually I found out that, in my specific case, the configuration directory was: C:\Users\USERNAME\AppData\Roaming\JetBrains\<product><version>[in my case: IdeaIC2021.2].
N.B. It wasn't so obvious to find out the path for the configuration directory, indeed the value reported inside C:\Users\USERNAME\AppData\Local\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\bin\idea.properties seemed to be incorrect since it was stated that the value of idea.config.path was ${user.home}/.IdeaIC/config

# Use ${idea.home.path} macro to specify location relative to IDE installation home.
# Use ${xxx} where xxx is any Java property (including defined in previous lines of this file) to refer to its value.
# Note for Windows users: please make sure you're using forward slashes: C:/dir1/dir2.

#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the settings directory.
#---------------------------------------------------------------------
# idea.config.path=${user.home}/.IdeaIC/config

However I didn't manage to find any .IdeaIC directory neither in my $HOME directory nor inside C:\Users\USERNAME\AppData\ directories. Nevertheless the value reported may be correct, but it seemed misleading to me since I'm not an expert of IntelliJ IDEA.

Upvotes: 0

Bohuslav Burghardt
Bohuslav Burghardt

Reputation: 34776

Not sure if it can be done from UI, but you could manually delete the history from IDE config files.

First go to configuration folder. Its location is platform specific, look here for details. For instance on OS X it's ~/Library/Preferences/<PRODUCT><VERSION>.

The open options/vcs.xml file which should look something like:

<application>
  <component name="GitRememberedInputs">
    <option name="visitedUrls">
      <list>
        <UrlAndUserName>
          <option name="url" value="<REPO URL>" />
          <option name="userName" value="" />
        </UrlAndUserName>
      </list>
    </option>
    <option name="cloneParentDir" value="/tmp" />
  </component>
  <component name="VcsApplicationSettings">
    <option name="PATCH_STORAGE_LOCATION" value="$USER_HOME$/Desktop" />
  </component>
</application>

And remove the <UrlAndUserName> elements you are not interested in. You might need to restart IntelliJ for it to take effect.

Upvotes: 4

Related Questions