git 从 GitKraken 概述中删除存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38068790/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Remove repository from GitKraken overview
提问by Mathias711
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?
我不小心在 GitKraken 中克隆了同一个存储库两次(不要问我怎么做的,我还在用 Git 学习),现在它在存储库概述中出现了两次。它都指向同一个文件夹,所以我不能只删除这个 repo,因为我也会丢失另一个。如何从概览中删除一个?
I can imagine this can also be useful for removing old repositories in GitKraken, but still have the files on your local computer.
我可以想象这对于删除 GitKraken 中的旧存储库也很有用,但仍然在本地计算机上保留文件。
回答by Tommaso Ercole
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%
文件夹或库文件夹(对于 MacOS)并找到该.gitkraken
文件夹。有一个配置文件文件夹,然后是您的配置文件 guid 文件夹。该目录应如下所示:
%APPDATA%\.gitkraken\profiles\<guid>
or
Users\<user>\.gitkraken\profiles\<guid>
%APPDATA%\.gitkraken\profiles\<guid>
或者
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.
在此文件夹中,您可以找到一个localRepoCache
文件。删除重复的条目,然后返回 Gitkraken 并根据需要重新添加它们。
回答by Ulfhetnar
Careful, this method also deletes the repo from the hard disk!
小心,这个方法也会从硬盘中删除repo!
Since version 3, you can also remove them inside the program.
从版本 3 开始,您还可以在程序中删除它们。
In the menu, where you can Open/Clone/Init repos, choose the open option.
在您可以打开/克隆/初始化存储库的菜单中,选择打开选项。
Under "Recently Opened" you see your repos. Right-click on the relevant entry et voilà...
在“最近打开”下,您会看到您的存储库。右键单击相关条目等等...
回答by VonC
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.
- 移动您实际的 dayfinder 文件夹(重命名)
- 删除 GitKraken 中的额外条目
- 将文件夹重命名回其原始名称。
The OP Mathias711adds in the comments:
该OP Mathias711增加的评论:
Even better: When I renamed it ("
dayfinder2
") it automatically updated his overview, and added the 2 and also removed the extra entry.
Removing the2
yields the expected output.
更好的是:当我重命名它 ("
dayfinder2
") 时,它会自动更新他的概览,并添加了 2 并删除了额外的条目。
删除2
产量预期的输出。
回答by devcodex
On Ubuntu, you can edit the localRepoCache
by:
在 Ubuntu 上,您可以localRepoCache
通过以下方式编辑:
cd ~/.gitkraken/profiles
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:
然后ls
获取目录内容的列表。进入目录,你会看到一个文件/s。就我而言,它是:
cd d6e5a8ca26e14325a4275fc33b17e16f
cd d6e5a8ca26e14325a4275fc33b17e16f
Edit the localRepoCache
file.
编辑localRepoCache
文件。
sudo vim localRepoCache
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.
只需从 GitKraken 概览屏幕中删除您想要删除的存储库。重新启动 GitKraken,你很好。
回答by Toby
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.
所有其他答案都非常合法,但我发现最简单的方法是简单地重命名您的项目文件夹,重新启动 gitkraken,尝试打开已删除的存储库,它会自动检测其已删除。
回答by Mohd
Just remove the folder from the hard disk and GitKraken will remove it fro its list.
只需从硬盘中删除文件夹,GitKraken 就会将其从列表中删除。