I’d been working away on the Bixo project, and pushing changes to GitHub without any problems.
Then I made the mistake of pulling in a new branch, versus creating the branch.
% git checkout origin cfetcher % git pull
This merged the remote branch into my local master branch, with bizarre results. After a few attempts at trying to back it out, I blew away my local directory and just re-cloned the remote cfetcher branch, since that’s where I’d be working for the next few days. Unfortunately when I cloned it, I did:
% git clone git://github.com/emi/bixo.git
That created a clone using the GitHub “Public Clone URL”, not the “Your Clone URL”, which is git@github.com:emi/bixo.git. Oops.
Everything worked, though, until I wanted to push back some changes:
% git push fatal: protocol error: expected sha/ref, got ' *********' You can't push to git://github.com/user/repo.git Use git@github.com:user/repo.git *********'
Expected sha/ref? Though the error message had all of the info I needed, just not in a format that was obvious. For example, a good message would have said:
You can't push to git://github.com/emi/bixo.git Update the url for the "origin" remote in your .git/config file to use git@github.com:emi/bixo.git
Eventually the Supercharged git-daemon blog post at GitHub cleared things up for me. I edited the URL entry in my .git/config file, and all is (once again) well.
[remote "origin"] url = git@github.com:emi/bixo.git fetch = +refs/heads/*:refs/remotes/origin/*
Thanks. Saved me some time on a day where I’d already wasted to much time!
Yup, as Lori, I’m *so* glad I found this. Thanks for documenting the problem.
Very much useful
Thanks for documenting this!