gpt4 book ai didi

git - refs/pull/*/head -> origin/pr/* 出现在 git pull

转载 作者:太空狗 更新时间:2023-10-29 14:30:12 25 4
gpt4 key购买 nike

从大约一个月前开始,每次我发出“git pull”命令时,我都会在我的“git branch -a”上得到一堆 remotes/origin/pr/* 分支,它们直接映射到在此 repo 协议(protocol)中曾经打开过 pull 请求。执行“git remote prune origin”清理它们。

pull 之前:

C:\experimental [develop]> git branch -a
* develop
feature/291
master
remotes/origin/HEAD -> origin/master

pull :

C:\experimental [develop]> git pull
From https://github.com/.../experimental
* [new ref] refs/pull/1/head -> origin/pr/1
* [new ref] refs/pull/10/head -> origin/pr/10
* [new ref] refs/pull/100/head -> origin/pr/100
* [new ref] refs/pull/101/head -> origin/pr/101
* [new ref] refs/pull/102/head -> origin/pr/102
* [new ref] refs/pull/103/head -> origin/pr/103
...
* [new ref] refs/pull/103/head -> origin/pr/382

pull 后:

C:\experimental [develop]> git branch -a
* develop
feature/291
master
remotes/origin/HEAD -> origin/master
remotes/origin/pr/1
remotes/origin/pr/10
remotes/origin/pr/100
remotes/origin/pr/101
remotes/origin/pr/102
remotes/origin/pr/103
...
remotes/origin/pr/382

清理:

C:\experimental [develop]> git remote prune origin
Pruning origin
URL: https://github.com/.../experimental.git
* [pruned] origin/pr/1
* [pruned] origin/pr/10
* [pruned] origin/pr/100
* [pruned] origin/pr/101
* [pruned] origin/pr/102
* [pruned] origin/pr/103
...
* [pruned] origin/pr/382

清理后:

C:\experimental [develop]> git branch -a
* develop
feature/291
master
remotes/origin/HEAD -> origin/master

如何阻止最初的“git pull”将它们 pull 下来?它只是在大约一个月前才开始发生。

谢谢。

最佳答案

可能您遵循了如何在本地检查 pull 请求的建议(请参阅 https://help.github.com/articles/checking-out-pull-requests-locally)。要摆脱这个,只需删除行

fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

来自你的 .git/config

关于git - refs/pull/*/head -> origin/pr/* 出现在 git pull,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17644164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com