39

I accidentally cloned the same repository twice in GitKraken (don't ask me how, I am still learning in Git), and now it shows up twice in the repo overview. It both point to the same folder, so I cannot just delete the repo, as I would have lost the other one too. How can I remove one from the overview?

I can imagine this can also be useful for removing old repositories in GitKraken, but still have the files on your local computer.

Double repo

Mathias711
  • 6,568
  • 4
  • 41
  • 58

6 Answers6

44

In fact you can easily go to your %APPDATA% folder or Library folder (for MacOS) and find the .gitkraken folder. There there is a profile folder and then your profile guid folder. The directory should look something like this:

%APPDATA%\.gitkraken\profiles\<guid>
or
Users\<user>\.gitkraken\profiles\<guid>

Inside this folder you can find a localRepoCache file. Remove the entries that are duplicated, then go back to Gitkraken and add them back as needed.

Community
  • 1
  • 1
Tommaso Ercole
  • 443
  • 5
  • 7
  • 1
    Where is "%APPDATA%" located exactly? I can't find it when opening the GitKraken show package contents. – Sean Dev Sep 05 '16 at 12:29
  • @SeanDev Press Windows button + R, type `%APPDATA` and press enter. – Mathias711 Sep 06 '16 at 07:47
  • 2
    @Mathias711 you missed the last %. You want to Press Windows + R (to open the run dialog) and paste in %APPDATA%. This is an environment variable that will open up your app data folder which varies depending on what your username is and what kind of profile you're using. For example, mine is currently: C:\Users\\AppData\Roaming. From there you can locate the .gitkraken folder and do the rest of OP's answer. – mikesigs Sep 23 '16 at 03:50
  • this is a better solution than renaming the repos as mentioned in the accpeted answer. – Naxos84 May 18 '17 at 08:21
  • 6
    Why is there not a "right click + remove" option? Seems like it should be so standard compared to other features O__o – dylanh724 Jun 30 '17 at 02:52
29

Careful, this method also deletes the repo from the hard disk!

Since version 3, you can also remove them inside the program.

In the menu, where you can Open/Clone/Init repos, choose the open option.

GitKraken < Open

Under "Recently Opened" you see your repos. Right-click on the relevant entry et voilà...

GitKraken, delete repo

Ulfhetnar
  • 681
  • 9
  • 11
  • 9
    You have to make sure the repository you want to delete isn't the currently opened one, otherwise no menu appears on right-click. – deed02392 Dec 12 '17 at 11:04
  • 6
    This is great information, but it is the opposite of what the OP wants. This will _delete_ the clone. The OP just wants gitkraken to forget about this record, because he made two entries in gitkraken pointing at the same clone. – GreenAsJade Feb 18 '18 at 22:57
  • Thanks for this one, real lifesaver – MetaSnarf Mar 02 '18 at 08:33
  • 1
    thanks to you and gitkraken this approach deleted repo from my computer :/ ,BEWARE if you want just delete it from gitkraken... (ubuntu 18) – Arash Jan 16 '19 at 09:38
  • @ArashMoosapour I have added this note to the post. Please excuse the circumstances – Ulfhetnar Jan 17 '19 at 10:42
7

You can try and:

  • move you actual dayfinder folder (rename it)
  • delete the extra entry in GitKraken
  • rename the folder back to its original name.

The OP Mathias711 adds in the comments:

Even better: When I renamed it ("dayfinder2") it automatically updated his overview, and added the 2 and also removed the extra entry.
Removing the 2 yields the expected output.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Hmm, even better. When I renamed it ("dayfinder2") it automatically updated his overview, and added the 2 and also removed the extra entry. Removing the 2 yields the expected output. Thanks! – Mathias711 Jun 28 '16 at 07:04
  • 2
    @Mathias711 Great! i have included your comment in the answer for more visibility. – VonC Jun 28 '16 at 07:06
  • 1
    This worked for me too. Isn't odd they have not a plain and simple "Remove repo" option? – Fran Marzoa Aug 25 '16 at 10:21
6

On Ubuntu, you can edit the localRepoCache by:

cd ~/.gitkraken/profiles

then ls to get a list of the content of the directory. Go inside the directory and you'll see a file/s. In my case it's:

cd d6e5a8ca26e14325a4275fc33b17e16f

Edit the localRepoCache file.

sudo vim localRepoCache

You'll be getting something like this:

{
 [
    "/home/user/your-project-dir/repo-1/.git",
    "/home/user/your-project-dir/repo-2/.git",
    "/home/user/your-project-dir/repo-3/.git",
    "/home/user/your-project-dir/repo-4/.git",
    "/home/user/your-project-dir/repo-5/.git" 
 ]
}

Just delete the repos you want to be removed from the GitKraken overview screen. Restart GitKraken and you're good.

devcodex
  • 101
  • 1
  • 5
3

All the other answers are very legit, but the easiest way I found is to simply rename your project folder, restart gitkraken, attempt to open the removed repository, and it will automatically detect its removed.

Toby
  • 33
  • 5
1

Just remove the folder from the hard disk and GitKraken will remove it fro its list.

Mohd
  • 81
  • 1
  • 8