问题
I've setup a Hudson continuous intgration server on an Ubuntu 8.04 slice, git version 1.6.4. I am able to have it pull code from a private repo GitHub, but I can't seem to get it to push the tags back after a build. I see the following:
# sudo -u hudson git push --tags
XML error: syntax error
error: Error: no DAV locking support on https://github.com/dealbase/dealbase/
error: failed to push some refs to 'https://github.com/dealbase/dealbase'
If I do "ssh -v git@github.com" from the hudson user, I can successfully authenticate to GitHub (which makes sense as well given I can pull/clone from a private repo). My impression is that this git push is trying to use WebDAV/run over HTTP or something when doing the push? My .gitconfig is the same as another user on the system (my regular, non-hudson user) which can successfully push tags.
回答1:
If you don't want to edit your .git/config
file by hand (or are scared of messing it up), you can use the git remote
commands to edit your remote repository list.
git remote show
will list the remote repositories that your local repository knows about, and git remote show <reponame>
will show the specifics of that given repo (like the push URL). You can git remote rm <reponame>
and git remote add <reponame> <repourl>
to reset it to your github ssh URL.
回答2:
Look into .git/config
(not ~/.gitconfig
) remote
section and make sure it has proper url value.
来源:https://stackoverflow.com/questions/1307864/git-push-to-github-failing-seems-to-be-trying-to-use-http