git - 什么是 Git 剪枝?

标签 git git-extensions

我不小心修剪了一些远程分支,我真的不知道这样做的后果是什么(我点击了 Git Extensions 中的“Prune remote branches”按钮,以为它会删除一个远程分支)。

官方文档说“git-prune - Prune all unreachable objects from the object database”。我真的不明白这是什么意思。我猜这可能已经删除了 merge 的分支,但我不太确定。

最佳答案

Git Extensions 中的“Prune remote branches”执行 git remote prune命令,它会删除您的本地远程跟踪分支,其中远程分支不再存在。

参见此处:https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-empruneem

Deletes stale references associated with <name>. By default, stale remote-tracking branches under <name> are deleted, but depending on global configuration and the configuration of the remote we might even prune local tags that haven’t been pushed there. Equivalent to git fetch --prune <name>, except that no new references will be fetched.

See the PRUNING section of git-fetch for what it’ll prune depending on various configuration.

With --dry-run option, report what branches would be pruned, but do not actually prune them.

关于git - 什么是 Git 剪枝?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36082788/

相关文章:

Git Extensions : rcs-keywords, 涂抹并清洁过滤器

GitExtensions 编辑器的 Windows .gitconfig 设置

Git 跟踪整个主目录。获取错误 - 致命 : bad default revision 'HEAD'

Git submodule.$name.url 覆盖不起作用

git 只删除最后的存储提交

git - 为什么 Git 允许我创建两个同名的分支?

Git 扩展 - 个人仓库和中央仓库的区别

Git:如何交换本地和远程的 2 个分支 (Github)

可以做目录差异的 git 客户端

ruby-on-rails - 不使用 git 将 Rails 应用程序部署到 Heroku?