eclipse pull提示the current branch is not configured for pull

今天在将本地代码commit,然后pushgithub后,误删了本地代码文件,想通过pull同步github服务器与eclipse的代码,也是第一次进行pull操作,然而在eclipse中悬选择了项目后,team-pull,提示the current branch is not configured for pull,no value for key remote.origin.url found in configuration,记录下解决方法:

 

根据提示知道,config文件中缺少了remote.origin.url参数,则在eclipse-window-preferences,找到git-configuration-repository settings,repository选择当前项目,可查看到当前config的配置,此时一般只有一个core项参数,需要添加branchremote参数,按下图添加

 

[core]

    repositoryformatversion = 0

    filemode = false

    logallrefupdates = true

    [branch "master"]

        remote = master

        merge = refs/heads/master

    [remote "master"]

        url = git服务器上该项目的地址

        fetch = +refs/heads/*:refs/remotes/origin/*

注:以上标紫色的字段需保持一致,否则pull还是会提示找不到url,可以填originmaster或其他已建分支;url地址自定义,我填写的是自己项目在git服务器上的地址。

 

如果是出现提示:the current branch is not configured for pull,no value for key branch.modify.merge found in configuration.则是因为在config文件中没有创建branch,仅需要在config文件中添加branch参数:

[branch "xxx"]
remote = origin
merge = refs/heads/xxx

 

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值