【问题】
折腾:
【记录】再次尝试用git上传BlogsToWordpress的代码到SourceForge中git仓库
期间,准备好git本地的代码后,去push,结果出错:
Administrator@PC-20130611GART /cygdrive/e/Dev_Root/SourceForge/git/BlogsToWordpress $ git push origin master ssh: Could not resolve hostname git.code.sf.net: Temporary failure in name resolution fatal: The remote end hung up unexpectedly
如图:
即:
ssh: Could not resolve hostname git.code.sf.net: Temporary failure in name resolution |
【解决过程】
1.关于:
Temporary failure in name resolution
的问题,网上参考了一些:
https://bitbucket.org/site/master/issue/6904/error-couldnt-resolve-host-bitbucketorg
看起来像是git服务器的问题?而不是自己的问题?
2.然后参考:
https://sourceforge.net/p/forge/documentation/Git/
去试试https:
果然,https,是可以上传代码的:
Administrator@PC-20130611GART /cygdrive/e/Dev_Root/SourceForge/git/BlogsToWordpress $ git remote add origin https://[email protected]/p/blogstowordpress/code fatal: remote origin already exists. Administrator@PC-20130611GART /cygdrive/e/Dev_Root/SourceForge/git/BlogsToWordpress $ git remote add origin https://[email protected]/p/blogstowordpress/code^C Administrator@PC-20130611GART /cygdrive/e/Dev_Root/SourceForge/git/BlogsToWordpress $ git remote add originhttps https://[email protected]/p/blogstowordpress/code Administrator@PC-20130611GART /cygdrive/e/Dev_Root/SourceForge/git/BlogsToWordpress $ git push originhttps master Password for 'https://[email protected]': Counting objects: 61, done. Delta compression using up to 4 threads. Compressing objects: 100% (60/60), done. Writing objects: 100% (61/61), 388.04 KiB, done. Total 61 (delta 19), reused 0 (delta 0) remote: <Repository /git/p/blogstowordpress/code.git> refresh queued. To https://[email protected]/p/blogstowordpress/code * [new branch] master -> master
3.然后,去SourceForge上面看看,是否的确已经有代码了:
然后的确是可以看到,刚刚提交的代码的:
4.然后在对应的master页面下,也是可以看到对应的代码的:
说明:
【总结】
此处,对于SourceForge的git,去push:
git push origin master
时出错:
ssh: Could not resolve hostname git.code.sf.net: Temporary failure in name resolution |
的原因是:
SourceForge的ssh的git,有问题。
解决办法是:
换用https的git,就可以了。
用法如下:
由于之前用:
git remote add origin ssh://[email protected]/p/blogstowordpress/code
已经命名了origin为
ssh://[email protected]/p/blogstowordpress/code
了,所以换个名字,originhttps,去命名https的git地址:
git remote add originhttps https://[email protected]/p/blogstowordpress/code
然后针对于https的git地址,再去push:
git push originhttps master
就可以了,就可以正常上传本地代码到git服务器了。
转载请注明:在路上 » 【已解决】对于SourceForge的git去git push结果出错:ssh: Could not resolve hostname git.code.sf.net: Temporary failure in name resolution