Error of Git

来源:互联网 发布:淘宝交易指数是什么 编辑:程序博客网 时间:2024/05/21 15:48

    本文旨在记录使用git时遇到的各种问题及解决方案,希望更多的人少走弯路。

1、eclipse 上传更新的时候出现:cannot open git-receive-pack


方案1:
可以试试下面的配置
windows-->Preferences-->Team-->Git-->Configuration-->User Settings.然后点Add Entry新建一个键值对,输入http.sslVerify=false
方案2:
重新Commit【虽然并没有增加什么】,再push。

2、cannot open git-upload-pack

首次share代码到github时:
share时配置文件未全部commit, cannot open git-upload-pack。
试了1的方法,失败;最后断开连接,删除本地仓库后重新share all,成功。
非首次:断开连接,删除本地仓库,pull到本地,再次commit【如果直接commit此时提交的会覆盖先前提交的】。

3、pull时异常:The current branch is not configured for pull No value for key remote.origin.url found in configuration

解决方案1:
找到当前工程的config文件,E:\WorkSpace\Algorithm\.git\config;
修改内容如下:
[core]
    symlinks = false
    repositoryformatversion = 0
    filemode = false
    logallrefupdates = true
[branch "master"] 
    remote = origin
    merge = refs/heads/master
[remote "origin"] 
    url = https://github.com/zxiaofan/Algorithm.git
    fetch = +refs/heads/*:refs/remotes/origin/*
解决方案2:
Window->Preference->Team->Git->Configuration->Repository Settings->选择当前repository,open,按方案1的内容修改。



0 0
原创粉丝点击