如何删除未使用的git分支

时间:2012-01-04 22:03:48

标签: git tortoisegit

如何从Tortoise-Git中删除未使用的git分支?这些分支已在本地和远程删除,我不想再使用此下拉列表了

enter image description here

4 个答案:

答案 0 :(得分:9)

从TortoiseGit 2.4.0.2开始,有一种方法可以让它执行>>> import requests >>> from bs4 import BeautifulSoup >>> req = requests.get('https://pythonprogramming.net/parsememcparseface/') >>> soup = BeautifulSoup(req.content.decode('utf-8','ignore')) Warning (from warnings module): File "C:\Python34\lib\site-packages\bs4\__init__.py", line 166 markup_type=markup_type)) UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently. To get rid of this warning, change this: BeautifulSoup([your markup]) to this: BeautifulSoup([your markup], "html.parser") >>> soup = BeautifulSoup(req.content.decode('utf-8','ignore'), 'html.parser') >>> print(soup.find_all('p')) [<p class="introduction">Oh, hello! This is a <span style="font-size:115%">wonderful</span> page meant to let you practice web scraping. This page was originally created to help people work with the <a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/" target="blank"><strong>Beautiful Soup 4</strong></a> library.</p>, <p>The following table gives some general information for the following <code>programming languages</code>:</p>, <p>I think it's clear that, on a scale of 1-10, python is:</p>, <p>Javascript (dynamic data) test:</p>, <p class="jstest" id="yesnojs">y u bad tho?</p>, <p>Whᶐt hαppéns now¿</p>, <p><a href="/sitemap.xml" target="blank"><strong>sitemap</strong></a></p>, <p> <a class="btn btn-flat white modal-close" href="#">Cancel</a>   <a class="waves-effect waves-blue blue btn btn-flat modal-action modal-close" href="#">Login</a> </p>, <p> <a class="btn btn-flat white modal-close" href="#">Cancel</a>   <button class="btn" type="submit" value="Register">Sign Up</button> </p>, <p class="grey-text text-lighten-4">Contact: Harrison@pythonprogramming.net.</p>, <p class="grey-text right" style="padding-right:10px">Programming is a superpower.</p>] 。在“同步”窗口中,您可以选择“清理陈旧的远程分支”,然后从本地缓存中删除所有已删除的远程分支。

我不知道以前的版本是否已存在,因为我通常使用命令行^^

答案 1 :(得分:7)

您需要运行git remote prune origin。这将摆脱远程跟踪分支,这些分支不再代表遥控器上的分支。

答案 2 :(得分:0)

也许你只是修剪/删除了分支,缓存不是最新的。您可以终止tgitcache.exe进程以重置缓存。

答案 3 :(得分:0)

您可以查看日志&#39;然后向下滚动到您看到分支标记的位置,右键单击并要求删除它。通常你会看到foo和origin / foo两次,你可能想删除它们。

我还没有找到与TortoiseGit GUI相同的git remote prune origin的方法。