Can't pull from develop

For some reason, I can’t pull from develop:

git pull

error: cannot lock ref 'refs/remotes/origin/develop': unable to resolve reference 'refs/remotes/origin/develop': reference broken
    From https://github.com/WeAreROLI/JUCE
     ! [new branch]          develop    -> origin/develop  (unable to update local ref)
    Auto packing the repository in background for optimum performance.
    See "git help gc" for manual housekeeping.
    warning: The last gc run reported the following. Please correct the root cause
    and remove .git/gc.log.
    Automatic cleanup will not be performed until the file is removed.

fatal: bad object refs/remotes/origin/develop
fatal: failed to run repack

I’ve never seen this before. Inside Sourcetree, I don’t see the develop branch either.

Help?!

Maybe it’s a SourceTree problem?

git clone --single-branch --branch develop https://github.com/WeAreROLI/JUCE 

works for me on Mojave

I get the same error on the command line.

What does your git clone line do?

This fixed it:

rm .git/refs/remotes/origin/develop
rm .git/gc.log
git fetch
1 Like

It just clones the develop branch

I think github was struggling yesterday, we had trouble with push/pull/PRs for maybe a couple of hours, even though the service status only showed minor problems and nothing related to push/pull

1 Like