Git push to GitHub failing - seems to be trying to use HTTP?

白昼怎懂夜的黑 提交于 2020-01-04 06:15:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!