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 firstname.lastname@example.org: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 email@example.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 firstname.lastname@example.org: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 = email@example.com:emi/bixo.git fetch = +refs/heads/*:refs/remotes/origin/*