refs/pull/*/head -> origin/pr/* appearing on a git pull
git, github
Solution
Probably you followed the suggestion how to check out pull requests locally (see https://help.github.com/articles/checking-out-pull-requests-locally ). To get rid of this, just remove the line
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
from your `.git/config`.
Problem
Since about a month ago, every time I issue a 'git pull', I end up with a bunch of remotes/origin/pr/* branches on my 'git branch -a', which map directly to the number of pull requests having ever been opened in this repo. Doing a 'git remote prune origin' cleans them up. Before 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 ``` After 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 ``` Cleanup : ``` 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 ``` After Cleanup : ``` C:\experimental [develop]> git branch -a * develop feature/291 master remotes/origin/HEAD -> origin/master ``` How do I stop the initial 'git pull' from pulling them down ? It only started to happen about a month and a bit ago. Thanks.